Instructions to use zai-org/glm-4-9b-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/glm-4-9b-chat with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/glm-4-9b-chat", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
duzx16 commited on
Commit ·
12c8049
1
Parent(s): cbc9aaf
Fix classification model
Browse files- modeling_chatglm.py +1 -1
modeling_chatglm.py
CHANGED
|
@@ -1174,7 +1174,7 @@ class ChatGLMForSequenceClassification(ChatGLMPreTrainedModel):
|
|
| 1174 |
)
|
| 1175 |
|
| 1176 |
hidden_states = transformer_outputs[0]
|
| 1177 |
-
pooled_hidden_states = hidden_states[-1]
|
| 1178 |
if self.dropout is not None:
|
| 1179 |
pooled_hidden_states = self.dropout(pooled_hidden_states)
|
| 1180 |
logits = self.classifier_head(pooled_hidden_states)
|
|
|
|
| 1174 |
)
|
| 1175 |
|
| 1176 |
hidden_states = transformer_outputs[0]
|
| 1177 |
+
pooled_hidden_states = hidden_states[:, -1]
|
| 1178 |
if self.dropout is not None:
|
| 1179 |
pooled_hidden_states = self.dropout(pooled_hidden_states)
|
| 1180 |
logits = self.classifier_head(pooled_hidden_states)
|