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

convert_llama_weights_to_hf #58

Closed
JosephChenHub opened this issue Apr 19, 2024 · 4 comments
Closed

convert_llama_weights_to_hf #58

JosephChenHub opened this issue Apr 19, 2024 · 4 comments

Comments

@JosephChenHub
Copy link

is there a script to convert weights to hf format?

@rupeshs
Copy link

rupeshs commented Apr 19, 2024

@JosephChenHub Are you looking for this https://huggingface.co/meta-llama/Meta-Llama-3-8B

@bkhanal-11
Copy link

bkhanal-11 commented Apr 19, 2024

@JosephChenHub you can use the script convert_llama_weights_to_hf.py. Also some instructions from llama-recipe:

## Install Hugging Face Transformers from source
pip freeze | grep transformers ## verify it is version 4.31.0 or higher

git clone git@github.com:huggingface/transformers.git
cd transformers
pip install protobuf
python src/transformers/models/llama/convert_llama_weights_to_hf.py \
   --input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir /output/path

This is not updated for llama3, but you can give it a go.

@ArthurZucker
Copy link
Collaborator

huggingface/transformers#30334 will add the script and everything you need

@jspisak
Copy link
Contributor

jspisak commented Apr 19, 2024

thanks @ArthurZucker! Closing this out as it's solved..

@jspisak jspisak closed this as completed Apr 19, 2024
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

5 participants