Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: forward() got an unexpected keyword argument 'cache_position' #42

Open
benja-matic opened this issue Jul 25, 2024 · 4 comments

Comments

@benja-matic
Copy link

benja-matic commented Jul 25, 2024

Hi,

I'm seeing the error above when running python -u run_text_generation.py --model_arch llama --model_name huggyllama/llama-13b --recent_ratio 0.1 --heavy_ratio 0.1 \. Please let me know if you have a fix, as I would really like to use this technique.

Notes on reproducibility:

I did make some small modifications to the code (set num_hidden_layers=4) in the model config for faster debugging. I am using transformers 4.44.0.dev0 (this is what gets installed when using the provided install instructions). I'm using a conda environment with python 3.8.

@wln20
Copy link

wln20 commented Jul 26, 2024

I also encounted this issue and found the problem as incompatibility of different versions of transformers. You may choose to use older versions to get around the problem:

pip install crfm-helm==0.2.3
pip install transformers==4.28.1
pip install lm-eval==0.3.0

@wln20
Copy link

wln20 commented Jul 31, 2024

Update: I discussed the dependency problem with the authors and they recommend to use transformers==4.33, I've tried it on llama-2-7b-chat and got correct responses.

@benja-matic
Copy link
Author

Thanks for the reply and reaching out to the authors. That worked for me using transformers==4.33, after applying the small changes in this PR #41.

Is there a plan to update to newer versions of transformers? If not, I'd be happy to update the installation instructions in the readme.

@wln20
Copy link

wln20 commented Aug 3, 2024

Thanks for the reply and reaching out to the authors. That worked for me using transformers==4.33, after applying the small changes in this PR #41.

Is there a plan to update to newer versions of transformers? If not, I'd be happy to update the installation instructions in the readme.

The authors also recommended to use a newly-built version based on llama-recipes (https://github.com/meta-llama/llama-recipes/tree/main/recipes/experimental/long_context/H2O), it works with transformers == 4.39.0. You may try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants