You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-13Lines changed: 38 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,37 @@
1
1
# Llama Recipes: Examples to get started using the Llama models from Meta
2
-
3
-
The 'llama-recipes' repository is a companion to the [Llama 2 model](https://github.com/facebookresearch/llama). The goal of this repository is to provide a scalable library for fine-tuning Llama 2, along with some example scripts and notebooks to quickly get started with using the Llama 2 models in a variety of use-cases, including fine-tuning for domain adaptation and building LLM-based applications with Llama 2 and other tools in the LLM ecosystem. The examples here showcase how to run Llama 2 locally, in the cloud, and on-prem.
4
-
2
+
<!-- markdown-link-check-disable -->
3
+
The 'llama-recipes' repository is a companion to the [Meta Llama 2](https://github.com/meta-llama/llama) and [Meta Llama 3](https://github.com/meta-llama/llama3) models. The goal of this repository is to provide a scalable library for fine-tuning Meta Llama models, along with some example scripts and notebooks to quickly get started with using the models in a variety of use-cases, including fine-tuning for domain adaptation and building LLM-based applications with Meta Llama and other tools in the LLM ecosystem. The examples here showcase how to run Meta Llama locally, in the cloud, and on-prem.
4
+
<!-- markdown-link-check-enable -->
5
+
> [!IMPORTANT]
6
+
> Llama 3 has a new prompt template and special tokens (based on the tiktoken tokenizer).
7
+
> | Token | Description |
8
+
> |---|---|
9
+
> `<\|begin_of_text\|>` | This is equivalent to the BOS token. |
10
+
> `<\|eot_id\|>` | This signifies the end of the message in a turn. |
11
+
> `<\|start_header_id\|>{role}<\|end_header_id\|>` | These tokens enclose the role for a particular message. The possible roles can be: system, user, assistant. |
12
+
> `<\|end_of_text\|>` | This is equivalent to the EOS token. On generating this token, Llama 3 will cease to generate more tokens |
13
+
>
14
+
> A multiturn-conversation with Llama 3 follows this prompt template:
> More details on the new tokenizer and prompt template: <PLACEHOLDER_URL>
5
27
> [!NOTE]
6
28
> The llama-recipes repository was recently refactored to promote a better developer experience of using the examples. Some files have been moved to new locations. The `src/` folder has NOT been modified, so the functionality of this repo and package is not impacted.
7
29
>
8
30
> Make sure you update your local clone by running `git pull origin main`
9
31
10
32
## Table of Contents
11
33
12
-
-[Llama Recipes: Examples to get started using the Llama models from Meta](#llama-recipes-examples-to-get-started-using-the-llama-models-from-meta)
34
+
- [Llama Recipes: Examples to get started using the Meta Llama models from Meta](#llama-recipes-examples-to-get-started-using-the-llama-models-from-meta)
You can find Llama 2 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.
101
+
### Getting the Meta Llama models
102
+
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.
81
103
82
104
#### Model conversion to Hugging Face
83
-
The recipes and notebooks in this folder are using the Llama 2 model definition provided by Hugging Face's transformers library.
105
+
The recipes and notebooks in this folder are using the Meta Llama model definition provided by Hugging Face's transformers library.
84
106
85
107
Given that the original checkpoint resides under models/7B you can install all requirements and convert the checkpoint with:
86
108
@@ -105,15 +127,15 @@ Most of the code dealing with Llama usage is organized across 2 main folders: `r
105
127
Contains examples are organized in folders by topic:
106
128
| Subfolder | Description |
107
129
|---|---|
108
-
[quickstart](./recipes/quickstart) | The "Hello World" of using Llama2, start here if you are new to using Llama2.
109
-
[finetuning](./recipes/finetuning)|Scripts to finetune Llama2 on single-GPU and multi-GPU setups
110
-
[inference](./recipes/inference)|Scripts to deploy Llama2 for inference locally and using model servers
130
+
[quickstart](./recipes/quickstart) | The "Hello World" of using Llama, start here if you are new to using Llama.
131
+
[finetuning](./recipes/finetuning)|Scripts to finetune Llama on single-GPU and multi-GPU setups
132
+
[inference](./recipes/inference)|Scripts to deploy Llama for inference locally and using model servers
111
133
[use_cases](./recipes/use_cases)|Scripts showing common applications of Llama2
112
134
[responsible_ai](./recipes/responsible_ai)|Scripts to use PurpleLlama for safeguarding model outputs
113
135
[llama_api_providers](./recipes/llama_api_providers)|Scripts to run inference on Llama via hosted endpoints
114
-
[benchmarks](./recipes/benchmarks)|Scripts to benchmark Llama 2 models inference on various backends
136
+
[benchmarks](./recipes/benchmarks)|Scripts to benchmark Llama models inference on various backends
115
137
[code_llama](./recipes/code_llama)|Scripts to run inference with the Code Llama models
116
-
[evaluation](./recipes/evaluation)|Scripts to evaluate fine-tuned Llama2 models using `lm-evaluation-harness` from `EleutherAI`
138
+
[evaluation](./recipes/evaluation)|Scripts to evaluate fine-tuned Llama models using `lm-evaluation-harness` from `EleutherAI`
117
139
118
140
### `src/`
119
141
@@ -133,5 +155,8 @@ Contains modules which support the example recipes:
133
155
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
134
156
135
157
## License
136
-
See the License file [here](LICENSE) and Acceptable Use Policy [here](USE_POLICY.md)
158
+
<!-- markdown-link-check-disable -->
159
+
See the License file for Meta Llama 2 [here](https://llama.meta.com/llama2/license/) and Acceptable Use Policy [here](https://llama.meta.com/llama2/use-policy/)
137
160
161
+
See the License file for Meta Llama 3 [here](https://llama.meta.com/llama3/license/) and Acceptable Use Policy [here](https://llama.meta.com/llama3/use-policy/)
0 commit comments