Upload MiniMaxAI_MiniMax-M2_1.txt with huggingface_hub
Browse files- MiniMaxAI_MiniMax-M2_1.txt +54 -0
MiniMaxAI_MiniMax-M2_1.txt
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
# Load model directly
|
| 3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
+
|
| 5 |
+
tokenizer = AutoTokenizer.from_pretrained("MiniMaxAI/MiniMax-M2")
|
| 6 |
+
model = AutoModelForCausalLM.from_pretrained("MiniMaxAI/MiniMax-M2")
|
| 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/MiniMaxAI_MiniMax-M2_1Y2KvMV.py", line 18, in <module>
|
| 25 |
+
model = AutoModelForCausalLM.from_pretrained("MiniMaxAI/MiniMax-M2")
|
| 26 |
+
File "/tmp/.cache/uv/environments-v2/e4552f1c3ca9047f/lib/python3.13/site-packages/transformers/models/auto/auto_factory.py", line 604, in from_pretrained
|
| 27 |
+
return model_class.from_pretrained(
|
| 28 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
| 29 |
+
pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs
|
| 30 |
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 31 |
+
)
|
| 32 |
+
^
|
| 33 |
+
File "/tmp/.cache/uv/environments-v2/e4552f1c3ca9047f/lib/python3.13/site-packages/transformers/modeling_utils.py", line 277, in _wrapper
|
| 34 |
+
return func(*args, **kwargs)
|
| 35 |
+
File "/tmp/.cache/uv/environments-v2/e4552f1c3ca9047f/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4881, in from_pretrained
|
| 36 |
+
hf_quantizer, config, dtype, device_map = get_hf_quantizer(
|
| 37 |
+
~~~~~~~~~~~~~~~~^
|
| 38 |
+
config, quantization_config, dtype, from_tf, from_flax, device_map, weights_only, user_agent
|
| 39 |
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 40 |
+
)
|
| 41 |
+
^
|
| 42 |
+
File "/tmp/.cache/uv/environments-v2/e4552f1c3ca9047f/lib/python3.13/site-packages/transformers/quantizers/auto.py", line 319, in get_hf_quantizer
|
| 43 |
+
hf_quantizer.validate_environment(
|
| 44 |
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
|
| 45 |
+
dtype=dtype,
|
| 46 |
+
^^^^^^^^^^^^
|
| 47 |
+
...<3 lines>...
|
| 48 |
+
weights_only=weights_only,
|
| 49 |
+
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 50 |
+
)
|
| 51 |
+
^
|
| 52 |
+
File "/tmp/.cache/uv/environments-v2/e4552f1c3ca9047f/lib/python3.13/site-packages/transformers/quantizers/quantizer_finegrained_fp8.py", line 48, in validate_environment
|
| 53 |
+
raise RuntimeError("No GPU or XPU found. A GPU or XPU is needed for FP8 quantization.")
|
| 54 |
+
RuntimeError: No GPU or XPU found. A GPU or XPU is needed for FP8 quantization.
|