Instructions to use zai-org/glm-4v-9b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/glm-4v-9b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/glm-4v-9b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
duzx16 commited on
Commit ·
301cb65
1
Parent(s): 710c94a
Use reshape for visual.py
Browse files
visual.py
CHANGED
|
@@ -66,7 +66,7 @@ class Attention(nn.Module):
|
|
| 66 |
out = attention_fn_default(
|
| 67 |
q, k, v
|
| 68 |
)
|
| 69 |
-
output = self.dense(out.transpose(1, 2).
|
| 70 |
output = self.output_dropout(output)
|
| 71 |
return output
|
| 72 |
|
|
|
|
| 66 |
out = attention_fn_default(
|
| 67 |
q, k, v
|
| 68 |
)
|
| 69 |
+
output = self.dense(out.transpose(1, 2).reshape(B, L, -1))
|
| 70 |
output = self.output_dropout(output)
|
| 71 |
return output
|
| 72 |
|