Upload cyankiwi_GLM-4.7-Flash-AWQ-4bit_1.txt with huggingface_hub
Browse files
cyankiwi_GLM-4.7-Flash-AWQ-4bit_1.txt
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
# Load model directly
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
+
|
| 5 |
+
tokenizer = AutoTokenizer.from_pretrained("cyankiwi/GLM-4.7-Flash-AWQ-4bit")
|
| 6 |
+
model = AutoModelForCausalLM.from_pretrained("cyankiwi/GLM-4.7-Flash-AWQ-4bit")
|
| 7 |
+
messages = [
|
| 8 |
+
{"role": "user", "content": "Who are you?"},
|
| 9 |
+
]
|
| 10 |
+
inputs = tokenizer.apply_chat_template(
|
| 11 |
+
messages,
|
| 12 |
+
add_generation_prompt=True,
|
| 13 |
+
tokenize=True,
|
| 14 |
+
return_dict=True,
|
| 15 |
+
return_tensors="pt",
|
| 16 |
+
).to(model.device)
|
| 17 |
+
|
| 18 |
+
outputs = model.generate(**inputs, max_new_tokens=40)
|
| 19 |
+
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
ERROR:
|
| 23 |
+
Traceback (most recent call last):
|
| 24 |
+
File "/tmp/cyankiwi_GLM-4.7-Flash-AWQ-4bit_19kQ86B.py", line 26, in <module>
|
| 25 |
+
tokenizer = AutoTokenizer.from_pretrained("cyankiwi/GLM-4.7-Flash-AWQ-4bit")
|
| 26 |
+
File "/tmp/.cache/uv/environments-v2/9cbdd13f85033a9e/lib/python3.13/site-packages/transformers/models/auto/tokenization_auto.py", line 1153, in from_pretrained
|
| 27 |
+
raise ValueError(
|
| 28 |
+
f"Tokenizer class {tokenizer_class_candidate} does not exist or is not currently imported."
|
| 29 |
+
)
|
| 30 |
+
ValueError: Tokenizer class TokenizersBackend does not exist or is not currently imported.
|