Open YunchaoYang opened 7 months ago
This example is from ref[2], where it train a conversation model.
creating a large jsonl file with chunks of conversations separated by a ### token to indicate the speaker.
Axolotl is used to streamline the fine-tuning of LLMs". All you is just a config a yaml file, to specify the base model and dataset.
Code Llama is a coding capabilities of Llama 2 . It can generate code, and natural language about code, from both code and natural language prompts It supports many of the most popular languages being used today, including Python, C++, Java, PHP, Typescript (Javascript), C#, and Bash.
https://ai.meta.com/blog/code-llama-large-language-model-coding/
Installation
In order to download the model weights and tokenizer, please visit the Meta website and accept License.
Prepare environment
How to use
inference
All models support sequence length up to 4096 tokens, but we pre-allocate the cache according to
max_seq_len
andmax_batch_size
values. So set those according to your hardware.Pretrained Models
These models are not finetuned for chat or Q&A. They should be prompted so that the expected answer is the natural continuation of the prompt.
See
example_text_completion.py
for some examples. To illustrate, see the command below to run it with the llama-2-7b model (nproc_per_node
needs to be set to theMP
value):Fine-tuned Chat Models
The fine-tuned models were trained for dialogue applications. To get the expected features and performance for them, a specific formatting defined in
chat_completion
needs to be followed, including theINST
and<<SYS>>
tags,BOS
andEOS
tokens, and the whitespaces and breaklines in between (we recommend callingstrip()
on inputs to avoid double-spaces).You can also deploy additional classifiers for filtering out inputs and outputs that are deemed unsafe. See the llama-recipes repo for an example of how to add a safety checker to the inputs and outputs of your inference code.
Examples using llama-2-7b-chat:
Llama 2 is a new technology that carries potential risks with use. Testing conducted to date has not \u2014 and could not \u2014 cover all scenarios. In order to help developers address these risks, we have created the Responsible Use Guide. More details can be found in our research paper as well.