|
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
compare_llama_weights.py | 1 year ago |
This is the reverse conversion for convert_llama_weights_to_hf.py
script from the transformer package.
test70B
.model-path
can be a Hugging Face hub model or a local hf model directory.
python -m llama_recipes.tools.convert_hf_weights_to_llama --model-path meta-llama/Llama-2-70b-chat-hf --output-dir test70B --model-size 70B
Checkout the official llama inference repo. Test using chat or text completion.
torchrun --nproc_per_node 8 example_chat_completion.py --ckpt_dir ./test70B --tokenizer_path ${llama_2_dir}/tokenizer.model
For validation, please compare the converted weights with official llama 2 weights
python compare_llama_weights.py test70B ${llama_2_70b_chat_dir}