torchtune.models¶
llama3 & llama3.1¶
All models from the Llama3 family.
To download the Llama3-8B-Instruct model:
tune download meta-llama/Meta-Llama-3-8B-Instruct --hf-token <HF_TOKEN>
To download the Llama3-70B-Instruct model:
tune download meta-llama/Meta-Llama-3-70B-Instruct --hf-token <HF_TOKEN> --ignore-patterns "original/consolidated*"
To download the Llama3.1 weights of the above models, you can instead download from Meta-Llama-3.1-8B-Instruct or Meta-Llama-3.1-70B-Instruct.
Build the decoder associated with the Llama3 model. |
|
Return a version of Llama3 (an instance of |
|
Builder for creating a Llama3 model initialized w/ the default 8b parameter values. |
|
Builder for creating a Llama3 8B model with LoRA enabled. |
|
Builder for creating a Llama3 8B model with QLoRA enabled. |
|
Builder for creating a Llama3 model initialized w/ the default 70B parameter values. |
|
Builder for creating a Llama3 70B model with LoRA enabled. |
|
Builder for creating a Llama3 70B model with QLoRA enabled. |
|
Tokenizer for Llama3. |
|
tiktoken tokenizer configured with Llama3 Instruct's special tokens, as described in https://llama.meta.com/docs/model-cards-and-prompt-formats/meta-llama-3 |
|
Build the decoder associated with the Llama3.1 model. |
|
Return a version of Llama3.1 (an instance of |
|
Builder for creating a Llama3.1 model initialized w/ the default 8b parameter values. |
|
Builder for creating a Llama3.1 8B model with LoRA enabled. |
|
Builder for creating a Llama3.1 8B model with QLoRA enabled. |
|
Builder for creating a Llama3.1 model initialized w/ the default 70B parameter values. |
|
Builder for creating a Llama3.1 70B model with LoRA enabled. |
|
Builder for creating a Llama3.1 70B model with QLoRA enabled. |
Note
The Llama3.1 tokenizer reuses the llama3.llama3_tokenizer builder class.
llama2¶
All models from the Llama2 family.
To download the Llama2-7B model:
tune download meta-llama/Llama-2-7b-hf --hf-token <HF_TOKEN>
To download the Llama2-13B model:
tune download meta-llama/Llama-2-13b-hf --hf-token <HF_TOKEN>
To download the Llama2-70B model:
tune download meta-llama/Llama-2-70b-hf --hf-token <HF_TOKEN>
Build the decoder associated with the Llama2 model. |
|
Return a version of Llama2 (an instance of |
|
Builder for creating a Llama2 model initialized w/ the default 7B parameter values from https://arxiv.org/abs/2307.09288 |
|
Builder for creating a Llama2 7B model with LoRA enabled. |
|
Builder for creating a Llama2 7B model with QLoRA enabled. |
|
Builder for creating a Llama2 model initialized w/ the default 13B parameter values from https://arxiv.org/abs/2307.09288 |
|
Builder for creating a Llama2 13B model with LoRA enabled. |
|
Builder for creating a Llama2 13B model with QLoRA enabled. |
|
Builder for creating a Llama2 model initialized w/ the default 70B parameter values from https://arxiv.org/abs/2307.09288 |
|
Builder for creating a Llama2 70B model with LoRA enabled. |
|
Builder for creating a Llama2 70B model with QLoRA enabled. |
|
Tokenizer for Llama2. |
|
Llama2's implementation of the SentencePiece tokenizer. |
code llama¶
Models from the Code Llama family.
To download the CodeLlama-7B model:
tune download codellama/CodeLlama-7b-hf --hf-token <HF_TOKEN>
Builder for creating a Code-Llama2 model initialized w/ the default 7B parameter values from https://arxiv.org/pdf/2308.12950.pdf |
|
Builder for creating a Code-Llama2 7B model with LoRA enabled. |
|
Builder for creating a Code-Llama2 7B model with QLoRA enabled. |
|
Builder for creating a Code-Llama2 model initialized w/ the default 13B parameter values from https://arxiv.org/pdf/2308.12950.pdf |
|
Builder for creating a Code-Llama2 13B model with LoRA enabled. |
|
Builder for creating a Code-Llama2 13B model with QLoRA enabled. |
|
Builder for creating a Code-Llama2 model initialized w/ the default 70B parameter values from https://arxiv.org/pdf/2308.12950.pdf |
|
Builder for creating a Code-Llama2 70B model with LoRA enabled. |
|
Builder for creating a Code-Llama2 70B model with QLoRA enabled. |
phi-3¶
Models from the Phi-3 mini family.
To download the Phi-3 Mini 4k instruct model:
tune download microsoft/Phi-3-mini-4k-instruct --hf-token <HF_TOKEN> --ignore-patterns ""
|
|
Return a version of Phi3 (an instance of |
|
Builder for creating the Phi3 Mini 4K Instruct Model. |
|
Builder for creating a Phi3 Mini (3.8b) model with LoRA enabled. |
|
Builder for creating a Phi3 mini model with QLoRA enabled. |
|
Phi-3 Mini tokenizer. |
|
SentencePiece tokenizer configured with Phi3 Mini's special tokens. |
mistral¶
All models from Mistral AI family.
To download the Mistral 7B v0.1 model:
tune download mistralai/Mistral-7B-v0.1 --hf-token <HF_TOKEN>
Build the decoder associated with the mistral model. |
|
Return a version of Mistral (an instance of |
|
Build a base mistral model with an added classification layer. |
|
Return a version of Mistral classifier (an instance of |
|
Builder for creating a Mistral 7B model initialized w/ the default 7b parameter values from https://mistral.ai/news/announcing-mistral-7b/ |
|
Builder for creating a Mistral 7B model with LoRA enabled. |
|
Builder for creating a Mistral model with QLoRA enabled. |
|
Builder for creating a Mistral 7B classifier model initialized w/ the default 7b parameter values from: https://huggingface.co/Ray2333/reward-model-Mistral-7B-instruct-Unified-Feedback |
|
Builder for creating a Mistral classifier 7B model with LoRA enabled. |
|
Builder for creating a Mistral classifier model with QLoRA enabled. |
|
Tokenizer for Mistral models. |
|
Mistral's implementation of the SentencePiece tokenizer |
gemma¶
Models of size 2B and 7B from the Gemma family.
To download the Gemma 2B model:
tune download google/gemma-2b --hf-token <HF_TOKEN> --ignore-patterns ""
To download the Gemma 7B model:
tune download google/gemma-7b --hf-token <HF_TOKEN> --ignore-patterns "gemma-7b.gguf"
Build the decoder associated with the gemma model. |
|
Return a version of Gemma with LoRA applied based on the passed in configuration. |
|
Builder for creating a Gemma 2B model initialized w/ the default 2b parameter values from: https://blog.google/technology/developers/gemma-open-models/ |
|
Builder for creating a Gemma 2B model with LoRA enabled. |
|
Builder for creating a Gemma model with QLoRA enabled. |
|
Builder for creating a Gemma 7B model initialized w/ the default 7b parameter values from: https://blog.google/technology/developers/gemma-open-models/ |
|
Builder for creating a Gemma 7B model with LoRA enabled. |
|
Builder for creating a Gemma model with QLoRA enabled. |
|
Tokenizer for Gemma. |
|
Gemma's implementation of the SentencePiece tokenizer |