Shortcuts

torchtune.models

llama3

All models from the Llama3 family.

tune download meta-llama/Meta-Llama-3-8B-Instruct --hf-token <ACCESS_TOKEN>

llama3.llama3_8b

Builder for creating a Llama3 model initialized w/ the default 8b parameter values.

llama3.llama3_70b

Builder for creating a Llama3 model initialized w/ the default 70B parameter values.

llama3.lora_llama3_8b

Builder for creating a Llama3 8B model with LoRA enabled.

llama3.qlora_llama3_8b

Builder for creating a Llama3 model with QLoRA enabled.

llama3.lora_llama3_70b

Builder for creating a Llama3 70B model with LoRA enabled.

llama2

All models from the Llama2 family.

Pre-trained models can be downloaded from the Hugging Face Hub with the following command:

tune download meta-llama/Llama-2-7b-hf --hf-token <ACCESS_TOKEN>

llama2.llama2_7b

Builder for creating a Llama2 model initialized w/ the default 7B parameter values from https://arxiv.org/abs/2307.09288

llama2.lora_llama2_7b

Builder for creating a Llama2 7B model with LoRA enabled.

llama2.qlora_llama2_7b

Builder for creating a Llama2 7B model with QLoRA enabled.

llama2.llama2_13b

Builder for creating a Llama2 model initialized w/ the default 13B parameter values from https://arxiv.org/abs/2307.09288

llama2.lora_llama2_13b

Builder for creating a Llama2 13B model with LoRA enabled.

llama2.qlora_llama2_13b

Builder for creating a Llama2 13B model with QLoRA enabled.

llama2.llama2_70b

Builder for creating a Llama2 model initialized w/ the default 70B parameter values from https://arxiv.org/abs/2307.09288

llama2.lora_llama2_70b

Builder for creating a Llama2 70B model with LoRA enabled.

phi-3

Models from the Phi-3 mini family.

Pre-trained models can be download from the Hugging Face Hub with the following command:

tune download microsoft/Phi-3-mini-4k-instruct --hf-token <HF_TOKEN> --ignore-patterns ""

phi3.phi3_mini

Builder for creating the Phi3 Mini 4K Instruct Model.

phi3.lora_phi3_mini

Builder for creating a Phi3 Mini (3.8b) model with LoRA enabled.

phi3.qlora_phi3_mini

Builder for creating a Phi3 mini model with QLoRA enabled.

mistral

All models from Mistral AI family.

Pre-trained models can be downloaded from the Hugging Face Hub with the following command:

tune download mistralai/Mistral-7B-v0.1

mistral.mistral_7b

Builder for creating a Mistral 7B model initialized w/ the default 7b parameter values from https://mistral.ai/news/announcing-mistral-7b/

mistral.lora_mistral_7b

Builder for creating a Mistral 7B model with LoRA enabled.

mistral.qlora_mistral_7b

Builder for creating a Mistral model with QLoRA enabled.

gemma

All models from the Gemma family.

Pre-trained models can be downloaded from the Hugging Face Hub with the following command:

tune download google/gemma-2b --hf-token <ACCESS_TOKEN> --ignore-patterns ""

gemma.gemma_2b

Builder for creating a Gemma 2B model initialized w/ the default 2b parameter values from: https://blog.google/technology/developers/gemma-open-models/

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources