Repository navigation
Closed
unslothai/unsloth-zoo
#182Labels
Description
- Did you update?
pip install --upgrade unsloth unsloth_zoo\
yes
ColaborKaggleor local / cloud
local
- Number GPUs used, use
nvidia-smi
RTX 3090
- Which notebook? Please link!
- Which Unsloth version, TRL version, transformers version, PyTorch version?
PyTorch
- Which trainer?
SFTTrainer,GRPOTraineretc```pythonPut Minimal code to reproduce error here ###Remove
SFTTRainer
- Hugging Face token###
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 432, in create_new_function
new_module, old_path = import_module(compile_folder, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 427, in import_module
new_module = importlib.import_module(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 991, in exec_module
File "<frozen importlib._bootstrap_external>", line 1129, in get_code
File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/root/Qwen3_8B/unsloth_compiled_cache/unsloth_compiled_module_qwen3.py", line 441
loss = self.loss_function(logits=logits, labels=labels.to(self.lm_head.weight.device), self.config.vocab_size, **kwargs)
^
SyntaxError: positional argument follows keyword argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 457, in create_new_function
spec.loader.exec_module(new_module)
File "<frozen importlib._bootstrap_external>", line 991, in exec_module
File "<frozen importlib._bootstrap_external>", line 1129, in get_code
File "<frozen importlib._bootstrap_external>", line 1059, in source_to_code
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/tmp/unsloth_compiled_cache/unsloth_compiled_module_qwen3.py", line 441
loss = self.loss_function(logits=logits, labels=labels.to(self.lm_head.weight.device), self.config.vocab_size, **kwargs)
^
SyntaxError: positional argument follows keyword argument
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 2156, in unsloth_compile_transformers
combined_module = create_new_function(
^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 459, in create_new_function
raise RuntimeError(f"Direct module loading failed for {name}: {e}")
RuntimeError: Direct module loading failed for unsloth_compiled_module_qwen3: positional argument follows keyword argument (unsloth_compiled_module_qwen3.py, line 441)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/Qwen3_8B/finetunning.py", line 13, in <module>
model, tokenizer = FastLanguageModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/unsloth/models/loader.py", line 109, in from_pretrained
return FastModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/unsloth/models/loader.py", line 701, in from_pretrained
model_types, supports_sdpa = unsloth_compile_transformers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/lib/python3.12/site-packages/unsloth/models/_utils.py", line 1239, in unsloth_compile_transformers
_unsloth_compile_transformers(
File "/root/miniconda3/lib/python3.12/site-packages/unsloth_zoo/compiler.py", line 2168, in unsloth_compile_transformers
raise RuntimeError(exception)
RuntimeError: Direct module loading failed for unsloth_compiled_module_qwen3: positional argument follows keyword argument
🦥 You can also ask via our Reddit page: https://www.reddit.com/r/unsloth/
Activity
joshuakelleyds commentedon Jun 27, 2025
Think it's a problem with the transformers release yesterday, try
pip install -U transformers==4.52.4, you might also need topip install -U unsloth==2025.06.04 unsloth-zoo==2025.06.04as this worked for me!icsy7867 commentedon Jun 27, 2025
This worked for me, thank you!
davebulaval commentedon Jul 3, 2025
You will also need
triton-3.3.0otherwise it still fails.kldzj commentedon Jul 4, 2025
Still failing for me eitherway. Installing
triton==3.3.0actually introduces new errors.