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
duzx16 commited on
Commit ·
220f772
1
Parent(s): f9f74fd
Fix overflow in FP16
Browse files- modeling_chatglm.py +1 -1
modeling_chatglm.py
CHANGED
|
@@ -51,7 +51,7 @@ class InvalidScoreLogitsProcessor(LogitsProcessor):
|
|
| 51 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
|
| 52 |
if torch.isnan(scores).any() or torch.isinf(scores).any():
|
| 53 |
scores.zero_()
|
| 54 |
-
scores[..., 20005] =
|
| 55 |
return scores
|
| 56 |
|
| 57 |
|
|
|
|
| 51 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
|
| 52 |
if torch.isnan(scores).any() or torch.isinf(scores).any():
|
| 53 |
scores.zero_()
|
| 54 |
+
scores[..., 20005] = 5e4
|
| 55 |
return scores
|
| 56 |
|
| 57 |
|