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

Meet problems when I use the file src/transformers/models/llama/convert_llama_weights_to_hf.py to transfer LlaMa-7B #30734

Open
2 of 4 tasks
wwxxyy1996 opened this issue May 9, 2024 · 2 comments

Comments

@wwxxyy1996
Copy link

System Info

image
When I use the file convert_llama_weights_to_hf.py to converted LlaMa-7B weights to the Hugging Face Transformers format, an error raised for the line 154 and said "RuntimeError: shape '[32, 2, 2, 4096]' is invalid for input of size 16777216".

My command
python convert_llama_weights_to_hf.py --input_dir ./ --model_size 7B --output_dir ./7B_hf

Here is my environments,
cuda-11.7, gcc-10.2.0, torch==2.0.0+cu117 torchvision==0.15.1+cu117, openai==0.27.8, transformers==4.41.0.dev0

Thank you very much!!

Who can help?

@ArthurZucker @pcuenca @Xe

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Just use this code to convert the model. The model size (consolidated.00.pth file) is 13G.

python convert_llama_weights_to_hf.py --input_dir ./ --model_size 7B --output_dir ./7B_hf

Expected behavior

Could you give me some suggestions?

@ArthurZucker
Copy link
Collaborator

Hey! This seems to be a duplicate of #30723, I'll check it out asap 😉

@wwxxyy1996
Copy link
Author

wwxxyy1996 commented May 10, 2024 via email

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