| ```CODE: |
| # Load model directly |
| from transformers import AutoProcessor, AutoModelForVision2Seq |
|
|
| processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-32B-Instruct-FP8") |
| model = AutoModelForVision2Seq.from_pretrained("Qwen/Qwen3-VL-32B-Instruct-FP8") |
| messages = [ |
| { |
| "role": "user", |
| "content": [ |
| {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, |
| {"type": "text", "text": "What animal is on the candy?"} |
| ] |
| }, |
| ] |
| inputs = processor.apply_chat_template( |
| messages, |
| add_generation_prompt=True, |
| tokenize=True, |
| return_dict=True, |
| return_tensors="pt", |
| ).to(model.device) |
|
|
| outputs = model.generate(**inputs, max_new_tokens=40) |
| print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) |
| ``` |
|
|
| ERROR: |
| Traceback (most recent call last): |
| File "/tmp/Qwen_Qwen3-VL-32B-Instruct-FP8_1AaH1ef.py", line 20, in <module> |
| model = AutoModelForVision2Seq.from_pretrained("Qwen/Qwen3-VL-32B-Instruct-FP8") |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/models/auto/modeling_auto.py", line 2289, in from_pretrained |
| return super().from_pretrained(pretrained_model_name_or_path, *model_args, **kwargs) |
| ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/models/auto/auto_factory.py", line 604, in from_pretrained |
| return model_class.from_pretrained( |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ |
| pretrained_model_name_or_path, *model_args, config=config, **hub_kwargs, **kwargs |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ) |
| ^ |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/modeling_utils.py", line 277, in _wrapper |
| return func(*args, **kwargs) |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/modeling_utils.py", line 4881, in from_pretrained |
| hf_quantizer, config, dtype, device_map = get_hf_quantizer( |
| ~~~~~~~~~~~~~~~~^ |
| config, quantization_config, dtype, from_tf, from_flax, device_map, weights_only, user_agent |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ) |
| ^ |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/quantizers/auto.py", line 319, in get_hf_quantizer |
| hf_quantizer.validate_environment( |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ |
| dtype=dtype, |
| ^^^^^^^^^^^^ |
| ...<3 lines>... |
| weights_only=weights_only, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ) |
| ^ |
| File "/tmp/.cache/uv/environments-v2/3a120645d4f704f5/lib/python3.13/site-packages/transformers/quantizers/quantizer_finegrained_fp8.py", line 48, in validate_environment |
| raise RuntimeError("No GPU or XPU found. A GPU or XPU is needed for FP8 quantization.") |
| RuntimeError: No GPU or XPU found. A GPU or XPU is needed for FP8 quantization. |
|
|