AttributeError: 'LlamaRotaryEmbedding' object has no attribute 'cos_cached'

#1
by hannahbernstein - opened

I'm following the example unsloth notebooks in order to fine-tune this model. The only thing I've changed is obviously the model and the prompt to follow a chat template for a different dataset. Once I get to trainer.train(), I get an AttributeError: 'LlamaRotaryEmbedding' object has no attribute 'cos_cached'.

Unsloth AI org

@hannahbernstein Thanks!! Saw the Github issue as well - will take a look later today - sorry on the issue!

Unsloth AI org
edited Feb 14

@hannahbernstein I found the issue! A new push a few days ago was made to the latest HuggingFace transformers branch https://github.com/huggingface/transformers/pull/27931 which broke it!!

I'm assuming you used the HF notebooks which we shared - for now I would comment out !pip install "git+https://github.com/huggingface/transformers.git" - we will install the correct version anyways.

Also if you're on a local PC, I would downgrade transformers via !pip install transformers==4.37.2

I will for now edit my notebooks to remove the lines - hope the temporary fix solves it!

It works - thanks so much!!

Sign up or log in to comment