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 +1 -1
tokenization_chatglm.py
CHANGED
|
@@ -67,7 +67,6 @@ class ChatGLMTokenizer(PreTrainedTokenizer):
|
|
| 67 |
|
| 68 |
def __init__(self, vocab_file, padding_side="left", clean_up_tokenization_spaces=False, **kwargs):
|
| 69 |
self.name = "GLMTokenizer"
|
| 70 |
-
super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces, **kwargs)
|
| 71 |
self.vocab_file = vocab_file
|
| 72 |
self.tokenizer = SPTokenizer(vocab_file)
|
| 73 |
self.special_tokens = {
|
|
@@ -75,6 +74,7 @@ class ChatGLMTokenizer(PreTrainedTokenizer):
|
|
| 75 |
"<eos>": self.tokenizer.eos_id,
|
| 76 |
"<pad>": self.tokenizer.pad_id
|
| 77 |
}
|
|
|
|
| 78 |
|
| 79 |
|
| 80 |
def get_command(self, token):
|
|
|
|
| 67 |
|
| 68 |
def __init__(self, vocab_file, padding_side="left", clean_up_tokenization_spaces=False, **kwargs):
|
| 69 |
self.name = "GLMTokenizer"
|
|
|
|
| 70 |
self.vocab_file = vocab_file
|
| 71 |
self.tokenizer = SPTokenizer(vocab_file)
|
| 72 |
self.special_tokens = {
|
|
|
|
| 74 |
"<eos>": self.tokenizer.eos_id,
|
| 75 |
"<pad>": self.tokenizer.pad_id
|
| 76 |
}
|
| 77 |
+
super().__init__(padding_side=padding_side, clean_up_tokenization_spaces=clean_up_tokenization_spaces, **kwargs)
|
| 78 |
|
| 79 |
|
| 80 |
def get_command(self, token):
|