Instructions to use zai-org/chatglm-6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/chatglm-6b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/chatglm-6b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
feat: stream block ended with newline
#56
by thincal - opened
- modeling_chatglm.py +1 -1
modeling_chatglm.py
CHANGED
|
@@ -1313,7 +1313,7 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
|
|
| 1313 |
response = tokenizer.decode(outputs)
|
| 1314 |
response = self.process_response(response)
|
| 1315 |
new_history = history + [(query, response)]
|
| 1316 |
-
yield response, new_history
|
| 1317 |
|
| 1318 |
@torch.no_grad()
|
| 1319 |
def stream_generate(
|
|
|
|
| 1313 |
response = tokenizer.decode(outputs)
|
| 1314 |
response = self.process_response(response)
|
| 1315 |
new_history = history + [(query, response)]
|
| 1316 |
+
yield response + "\n", new_history
|
| 1317 |
|
| 1318 |
@torch.no_grad()
|
| 1319 |
def stream_generate(
|