You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Been trying to fine tune Meta-Llama-3.1-8B model, all goes well until it can't generate outputs. Some thing is wrong with the attention_mask and idk why. I also can't generate text in the original notebook for Llama3-8B. Anyone have any idea?
File "/usr/local/lib/python3.11/dist-packages/unsloth/models/llama.py", line 727, in LlamaModel_fast_forward
attention_mask = attention_mask.to(torch.bool)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to'
changed the title [-]attention_mask = attention_mask.to(torch.bool) error[/-][+][FIXED] `attention_mask = attention_mask.to(torch.bool)`[/+]on Feb 14, 2025
This should be fixed now - sorry on the delay - please update with uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir - if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!
Activity
Marekoro commentedon Feb 14, 2025
File "/usr/local/lib/python3.11/dist-packages/unsloth/models/llama.py", line 727, in LlamaModel_fast_forward
attention_mask = attention_mask.to(torch.bool)
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'to'
same problem using qwen2.5 models
SunVictor23 commentedon Feb 14, 2025
I also have the same question!
torahoang commentedon Feb 14, 2025
unsloth/llama-3-8b-bnb-4bit also have the same problem with inference
kkailaasa commentedon Feb 14, 2025
Facing same issue, I think it is happening after #1699 was patched. This issue was also raised here #issuecomment-2658058664
danielhanchen commentedon Feb 14, 2025
Working on a fix as we speak - apologies on the issues!
danielhanchen commentedon Feb 14, 2025
Ok fixed - apologies - all Colab / Kaggle instances will need a refresh.
For fresh installs,
pip install unslothwill work. Updating for local machines:pip install --upgrade --force-reinstall --no-deps unsloth[-]attention_mask = attention_mask.to(torch.bool) error[/-][+][FIXED] `attention_mask = attention_mask.to(torch.bool)`[/+]kkailaasa commentedon Feb 14, 2025
@danielhanchen Thank you so much, testing it out now
danielhanchen commentedon Jun 18, 2026
This should be fixed now - sorry on the delay - please update with
uv pip install --upgrade unsloth unsloth_zoo --force-reinstall --no-cache-dir- if it's not fixed yet, it'll be in the next pip / PyPI release - if it's still not working after that, please open another issue - appreciate it again!