Beto 980455ce17 Fixing typo, adding HuggingFace and llamaguard to the wordlist hace 1 año
..
chat_completion b4c71bebee Update chat_completion.py hace 1 año
code_llama 2374b73aad Remove __init__.py files from examples hace 1 año
hf_llama_conversion cf0c589dc6 add doc string hace 1 año
hf_text_generation_inference 2374b73aad Remove __init__.py files from examples hace 1 año
llama_guard fe40d7f60e Adding the new llama inference code into the relevant readmes hace 1 año
vllm 3ddf755539 Move examples into subfolders hace 1 año
Getting_to_know_Llama.ipynb 0190444849 minor updates hace 1 año
Purple_Llama_Anyscale.ipynb 9c7d290615 add Purple_Llama_Anyscale.ipynb to examples hace 1 año
README.md 980455ce17 Fixing typo, adding HuggingFace and llamaguard to the wordlist hace 1 año
custom_dataset.py 8620ab8ac2 Fix invalid labels for context in custom dataset/oasst1 hace 1 año
finetuning.py 7702d702cc Add missing file extension hace 1 año
inference.py d92226a873 Removing option for local model, it's not working as expected. Would need further testing with the models from HF hace 1 año
multi_node.slurm 360a658262 Adjusted docs to reflect move of qs nb + finetuning script into examples hace 1 año
quickstart.ipynb a0cd3c7c77 Added dependency to qsnb hace 1 año
samsum_prompt.txt ccda6fb8ca Move inference scripts into example folder hace 1 año

README.md

Examples

This folder contains finetuning and inference examples for Llama 2, Code Llama and (Purple Llama](https://ai.meta.com/llama/purple-llama/). For the full documentation on these examples please refer to docs/inference.md

Finetuning

Please refer to the main README.md for information on how to use the finetuning.py script. After installing the llama-recipes package through pip you can also invoke the finetuning in two ways:

python -m llama_recipes.finetuning <parameters>

python examples/finetuning.py <parameters>

Please see README.md for details.

Inference

So far, we have provide the following inference examples:

  1. inference script script provides support for Hugging Face accelerate, PEFT and FSDP fine tuned models. It also demonstrates safety features to protect the user from toxic or harmful content.

  2. vllm/inference.py script takes advantage of vLLM's paged attention concept for low latency.

  3. The hf_text_generation_inference folder contains information on Hugging Face Text Generation Inference (TGI).

  4. A chat completion example highlighting the handling of chat dialogs.

  5. Code Llama folder which provides examples for code completion and code infilling.

  6. The Purple Llama Using Anyscale is a notebook that shows how to use Anyscale hosted Llama Guard model to classify user inputs as safe or unsafe.

  7. Llama Guard inference example and safety_checker for the main inference script. The standalone scripts allows to test Llama Guard on user input, or user input and agent response pairs. The safety_checker integration providers a way to integrate Llama Guard on all inference executions, both for the user input and model output.

For more in depth information on inference including inference safety checks and examples, see the inference documentation here.

Note The sensitive topics safety checker utilizes AuditNLG which is an optional dependency. Please refer to installation section of the main README.md for details.

Note The vLLM example requires additional dependencies. Please refer to installation section of the main README.md for details.

Train on custom dataset

To show how to train a model on a custom dataset we provide an example to generate a custom dataset in custom_dataset.py. The usage of the custom dataset is further described in the datasets README.