Instructions to use zai-org/chatglm2-6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zai-org/chatglm2-6b with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zai-org/chatglm2-6b", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update tokenization_chatglm.py
Browse files- tokenization_chatglm.py +1 -0
tokenization_chatglm.py
CHANGED
|
@@ -200,6 +200,7 @@ class ChatGLMTokenizer(PreTrainedTokenizer):
|
|
| 200 |
padding_strategy: PaddingStrategy = PaddingStrategy.DO_NOT_PAD,
|
| 201 |
pad_to_multiple_of: Optional[int] = None,
|
| 202 |
return_attention_mask: Optional[bool] = None,
|
|
|
|
| 203 |
) -> dict:
|
| 204 |
"""
|
| 205 |
Pad encoded inputs (on left/right and up to predefined length or max length in the batch)
|
|
|
|
| 200 |
padding_strategy: PaddingStrategy = PaddingStrategy.DO_NOT_PAD,
|
| 201 |
pad_to_multiple_of: Optional[int] = None,
|
| 202 |
return_attention_mask: Optional[bool] = None,
|
| 203 |
+
padding_side: Optional[str] = None,
|
| 204 |
) -> dict:
|
| 205 |
"""
|
| 206 |
Pad encoded inputs (on left/right and up to predefined length or max length in the batch)
|