-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
- Did you update?
pip install --upgrade unsloth unsloth_zoo
- YES
ColaborKaggleor local / cloud
- LOCAL, Linux
- Number GPUs used, use
nvidia-smi
- ONE
- Which notebook? Please link!
- N/A
-
Which Unsloth version, TRL version, transformers version, PyTorch version?
2025.11.3, Transformers 4.57.1 , 2.9.0+cu128 -
Which trainer?
SFTTrainer,GRPOTraineretc
FAILS on loading model.
Put Minimal code to reproduce error here ###Remove Hugging Face token###🦥 You can also ask via our Reddit page: https://www.reddit.com/r/unsloth/
CODE:
model, tokenizer = FastVisionModel.from_pretrained(
model_name="/mnt/e/Qwen3-vl-8B-20x-2",
max_seq_length=max_seq_length,
dtype=dtype,
load_in_4bit=True,
# VISION
use_gradient_checkpointing = "unsloth"
# local_files_only=True
)
FAILS to LOAD MODEL:
python3 instruct-12B-QwenVL-4bit-r64--VISION--PKD2--lnx-split.py
🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.
🦥 Unsloth Zoo will now patch everything to make training faster!
Traceback (most recent call last):
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 667, in create_new_function
new_module, old_path = import_module(compile_folder, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 663, in import_module
raise e
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 658, in import_module
new_module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 991, in exec_module
File "", line 1129, in get_code
File "", line 1059, in source_to_code
File "", line 488, in _call_with_frames_removed
File "/mnt/f/unsloth/unsloth_compiled_cache/unsloth_compiled_module_qwen3_vl.py", line 612
()
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 694, in create_new_function
spec.loader.exec_module(new_module)
File "", line 991, in exec_module
File "", line 1129, in get_code
File "", line 1059, in source_to_code
File "", line 488, in _call_with_frames_removed
File "/tmp/unsloth_compiled_cache/unsloth_compiled_module_qwen3_vl.py", line 612
()
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 2971, in unsloth_compile_transformers
combined_module = create_new_function(
^^^^^^^^^^^^^^^^^^^^
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 696, in create_new_function
raise RuntimeError(f"Direct module loading failed for {name}: {e}")
RuntimeError: Direct module loading failed for unsloth_compiled_module_qwen3_vl: invalid syntax (unsloth_compiled_module_qwen3_vl.py, line 612)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/mnt/f/unsloth/instruct-12B-QwenVL-4bit-r64--VISION--PKD2--lnx-split.py", line 23, in
model, tokenizer = FastVisionModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/.local/lib/python3.12/site-packages/unsloth/models/loader.py", line 1009, in from_pretrained
model_types, supports_sdpa = unsloth_compile_transformers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/.local/lib/python3.12/site-packages/unsloth/models/_utils.py", line 1858, in unsloth_compile_transformers
_unsloth_compile_transformers(
File "/home/david/.local/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 2983, in unsloth_compile_transformers
raise RuntimeError(exception)
RuntimeError: Direct module loading failed for unsloth_compiled_module_qwen3_vl: invalid syntax (unsloth_compiled_module_qwen3_vl.py, line 612)