Skip to content

Commit c4eacac

Browse files
committed
hf conversion updates
1 parent 6ade4eb commit c4eacac

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The 'llama-recipes' repository is a companion to the [Meta Llama](https://github
3232
- [Install with pip](#install-with-pip)
3333
- [Install with optional dependencies](#install-with-optional-dependencies)
3434
- [Install from source](#install-from-source)
35-
- [Getting the Meta Llama models](#getting-the-meta-llama-models)
35+
- [Getting the Llama models](#getting-the-llama-models)
3636
- [Model conversion to Hugging Face](#model-conversion-to-hugging-face)
3737
- [Repository Organization](#repository-organization)
3838
- [`recipes/`](#recipes)
@@ -95,23 +95,21 @@ pip install -e .[tests,auditnlg,vllm]
9595
```
9696

9797

98-
### Getting the Meta Llama models
99-
You can find Meta Llama models on Hugging Face hub [here](https://huggingface.co/meta-llama), **where models with `hf` in the name are already converted to Hugging Face checkpoints so no further conversion is needed**. The conversion step below is only for original model weights from Meta that are hosted on Hugging Face model hub as well.
98+
### Getting the Llama models
99+
You can find Llama models on Hugging Face hub [here](https://huggingface.co/meta-llama), **where models with `hf` in the name are already converted to Hugging Face checkpoints so no further conversion is needed**. The conversion step below is only for original model weights from Meta that are hosted on Hugging Face model hub as well.
100100

101101
#### Model conversion to Hugging Face
102-
The recipes and notebooks in this folder are using the Meta Llama model definition provided by Hugging Face's transformers library.
103-
104-
Given that the original checkpoint resides under models/7B you can install all requirements and convert the checkpoint with:
102+
If you have the model checkpoints downloaded from the Meta website, you can convert it to the Hugging Face format with:
105103

106104
```bash
107105
## Install Hugging Face Transformers from source
108-
pip freeze | grep transformers ## verify it is version 4.31.0 or higher
106+
pip freeze | grep transformers ## verify it is version 4.45.0 or higher
109107

110108
git clone [email protected]:huggingface/transformers.git
111109
cd transformers
112110
pip install protobuf
113111
python src/transformers/models/llama/convert_llama_weights_to_hf.py \
114-
--input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir /output/path
112+
--input_dir /path/to/downloaded/llama/weights --model_size 3B --output_dir /output/path
115113
```
116114

117115

0 commit comments

Comments
 (0)