Update LLaMA-model.md (#2460)

Better approach of converting LLaMA model
This commit is contained in:
zaypen 2023-06-08 02:34:50 +08:00 committed by GitHub
parent eb2601a8c3
commit 084b006cfe
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,15 @@ pip install protobuf==3.20.1
2. Use the script below to convert the model in `.pth` format that you, a fellow academic, downloaded using Meta's official link:
### [convert_llama_weights_to_hf.py](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py)
### Convert LLaMA to HuggingFace format
If you have `transformers` installed in place
```
python -m transformers.models.llama.convert_llama_weights_to_hf --input_dir /path/to/LLaMA --model_size 7B --output_dir /tmp/outputs/llama-7b
```
Otherwise download script [convert_llama_weights_to_hf.py](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py)
```
python convert_llama_weights_to_hf.py --input_dir /path/to/LLaMA --model_size 7B --output_dir /tmp/outputs/llama-7b