Instructions to use katuni4ka/tiny-random-chatglm2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use katuni4ka/tiny-random-chatglm2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="katuni4ka/tiny-random-chatglm2", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("katuni4ka/tiny-random-chatglm2", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update tokenization_chatglm.py
Browse files- tokenization_chatglm.py +3 -0
tokenization_chatglm.py
CHANGED
|
@@ -70,6 +70,9 @@ class ChatGLMTokenizer(PreTrainedTokenizer):
|
|
| 70 |
|
| 71 |
self.vocab_file = vocab_file
|
| 72 |
self.tokenizer = SPTokenizer(vocab_file)
|
|
|
|
|
|
|
|
|
|
| 73 |
self.special_tokens = {
|
| 74 |
"<bos>": self.tokenizer.bos_id,
|
| 75 |
"<eos>": self.tokenizer.eos_id,
|
|
|
|
| 70 |
|
| 71 |
self.vocab_file = vocab_file
|
| 72 |
self.tokenizer = SPTokenizer(vocab_file)
|
| 73 |
+
kwargs.pop("eos_token", None)
|
| 74 |
+
kwargs.pop("pad_token", None)
|
| 75 |
+
kwargs.pop("unk_token", None)
|
| 76 |
self.special_tokens = {
|
| 77 |
"<bos>": self.tokenizer.bos_id,
|
| 78 |
"<eos>": self.tokenizer.eos_id,
|