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
{{ message }}
Repository navigation
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'LongRopeRotaryEmbedding' object has no attribute 'long_cos_cached'. Did you mean: 'short_cos_cached'? #1189
Hello , I have been facing this issue , with PHI 3.5 mini Instruct bnb 4Bit model. I am trying to do the Few shot prompting for my dataset . there i am getting this issue . I case of SFT as well , same issue is coming with PHI model . others life LLama and Mistral works fine. Could anyone pknow hwta should be done to fix this scenario.?
I think it happens only for those sequences that exceed the 4096 token length during generation.
It seems somehow related to how the embeddings are cached, but I don't know how to fix or handle this issue.
I observed that the error is not thrown, if you run a sequence of length >4096 through the model before making inference on others (I guess causing the long_cos_cached attribute to be set). In that case it seems to work, however I noticed that the model then outputs non-sensical/ random stuff when exceeding a sequence length of 4096 tokens... Not sure if this is another issue. The behaviour seems pretty odd to me.
Edit: I gathered my observations for this bug in this notebook. Maybe this is helpful to understand/ debug the issue for someone with more knowledge...
Fixed by @Erland366! Please update Unsloth through the nightly branch for now via pip uninstall unsloth -y && pip install --upgrade --no-cache-dir --no-deps "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
Activity
NicolasSteen commentedon Oct 25, 2024
I encounter the same error with "unsloth/Phi-3.5-mini-instruct"
AttributeError: 'LongRopeRotaryEmbedding' object has no attribute 'long_cos_cached'For me the error occurs only in cases where the input-sequence is below 4096 tokens and the total output sequence exceeds the 4096 tokens.
If both prompt and total output are below or above 4096 tokens the error does not occur.
SnehaKumari14 commentedon Oct 25, 2024
yes for me it is happening for certain input sequence .how did you handle this .?
NicolasSteen commentedon Oct 25, 2024
I think it happens only for those sequences that exceed the 4096 token length during generation.
It seems somehow related to how the embeddings are cached, but I don't know how to fix or handle this issue.
I observed that the error is not thrown, if you run a sequence of length >4096 through the model before making inference on others (I guess causing the
long_cos_cachedattribute to be set). In that case it seems to work, however I noticed that the model then outputs non-sensical/ random stuff when exceeding a sequence length of 4096 tokens... Not sure if this is another issue. The behaviour seems pretty odd to me.Edit: I gathered my observations for this bug in this notebook. Maybe this is helpful to understand/ debug the issue for someone with more knowledge...
danielhanchen commentedon Oct 26, 2024
Fixed by @Erland366! Please update Unsloth through the nightly branch for now via
pip uninstall unsloth -y && pip install --upgrade --no-cache-dir --no-deps "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"NicolasSteen commentedon Oct 26, 2024
Thanks a lot for taking care so quickly!
However, the model output after 4096 tokens is still gibberish... (as mentioned by @Erland366 in #1193 )
@danielhanchen should I open a new issue for this?
danielhanchen commentedon Oct 27, 2024
@NicolasSteen Yep open a new issue thanks - I'm investigating as well!
NicolasSteen commentedon Oct 27, 2024
Submitted a new issue: #1199