Fine-Tuning Your Own Llama 2 Model
In this session, we take a step-by-step approach to fine-tune a Llama 2 model on a custom dataset.
Maxime Labonne
Utwórz bezpłatne konto
Ćwicz i monitoruj swoje postępy.
Kontynuuj z GoogleKontynuując, akceptujesz nasz Warunki użytkowania, nasz Polityka prywatności i że Twoje dane są przechowywane w USA.Powiązane
Samouczek
Fine-Tuning Llama 2 on Consumer Hardware: A Complete QLoRA Tutorial
Learn how to fine-tune Llama 2 on a free Google Colab GPU using QLoRA, PEFT, and the Hugging Face ecosystem to customize open-source LLMs for your use case.
Samouczek
Fine-Tuning Llama 3 and Using It Locally: A Step-by-Step Guide
We'll fine-tune Llama 3 on a dataset of patient-doctor conversations, creating a model tailored for medical dialogue. After merging, converting, and quantizing the model, it will be ready for private local use via the Jan application.

Samouczek
Fine-tuning Llama 3.2 and Using It Locally: A Step-by-Step Guide
Learn how to access Llama 3.2 lightweight and vision models on Kaggle, fine-tune the model on a custom dataset using free GPUs, merge and export the model to the Hugging Face Hub, and convert the fine-tuned model to GGUF format so it can be used locally with the Jan application.


The advent of large language models has taken the AI world by storm. Outside of proprietary foundation models like GPT-4, open-source models are playing a pivotal role in driving the AI revolution forward, democratizing access for anyone looking to leverage these models in production. One of the biggest challenges in generating high-quality output from open-source models rests in fine-tuning, where we improve their outputs based on a series of instructions.
In this session, we take a step-by-step approach to fine-tune a Llama 2 model on a custom dataset. First, we build our own dataset using techniques to remove duplicates and analyze the number of tokens. Then, we fine-tune the Llama 2 model using state-of-the art techniques from the Axolotl library. Finally, we see how to run our fine-tuned model and evaluate its performance.
Key Takeaways:
Note: To participate in this code-along, you will need to have a valid Google Colab account. Get started here.
Additional Resources
Solution Notebook (dataset)
Solution Model
[SKILL TRACK] AI Fundamentals
[BLOG] Introduction to Meta AI’s LLaMA
[BLOG] Fine-Tuning LLaMA 2: A Step-by-Step Guide to Customizing the Large Language Model
[BLOG] Llama.cpp Tutorial: A Complete Guide to Efficient LLM Inference and Implementation