Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Ultimate Guide to Fine Tuning LLM with HuggingFace LLama GPT
Rating: 3.7 out of 5(27 ratings)
186 students

Ultimate Guide to Fine Tuning LLM with HuggingFace LLama GPT

Unleash the Power of AI: Master Fine-Tuning Techniques for LLama3 and GPT Models for Enhanced Machine Learning
Last updated 10/2024
English
English [Auto],

What you'll learn

  • Fine tune a Llama Transformer model using HuggingFace
  • Learn how to use the SFT Trainer from HuggingFace for training
  • Learn how to use an instruction tuning dataset for language modeling alignment
  • Learn the basics of supervised fine tuning using HuggingFace
  • Learn how to use generative AI and machine learning on your own data

Course content

1 section5 lectures42m total length
  • Introduction0:25

    Explore fine-tuning a tiny llama 1.1 billion parameter model with Hugging Face, using a Nvidia A100 GPU and a Google Colab notebook on an instruction tuning data set.

  • Package Installation and Dataset Creation5:34

    Install essential huggingface libraries and trl, run on google colab with a Nvidia a100, and load the databricks dataset to train a tiny llama 1.1 b on instruction response pairs.

  • Accuracy Metrics Creation7:41

    Write evaluation methods for llama model logits, apply softmax to derive token probabilities, and compute accuracy against shifted labels using HuggingFace evaluate with -100 masking.

  • Llama Model Setup16:32

    Load the Tiny Llama model and dataset from Huggingface. Set up the tokenizer and padding, and configure the TRL trainer with a data collator for completion language modeling.

  • Training the Model12:43

    Fine-tune a Hugging Face llama gpt model by configuring training args, a completion-only data collator, context-aware tokenization, gradient checkpointing, and step-based evaluation for improved loss and accuracy.

Requirements

  • A Google Colab account is necessary. Preferably with compute units for higher memory GPUs. A basic knowledge of PyTorch, Python and machine learning is expected also.

Description

Dive into the world of AI with our comprehensive Udemy course, designed for enthusiasts eager to master instruction tuning, or supervised fine-tuning (SFT), using the incredibly powerful Tiny Llama 1.1B model. This course is perfect for data scientists, ML engineers, and anyone interested in the practical applications of fine-tuning large language models.

Our curriculum is specially crafted to provide you with hands-on experience using the Tiny Llama 1.1B model, trained on a vast 3 trillion tokens and paired with the Databricks-crafted Dolly 15k record dataset. Through this course, you'll not only learn the basics of SFT but also how to effectively use the HuggingFace Transformers library to prepare your dataset, set up training, and compute accuracy—all within the accessible environment of Google Colab.

What You Will Learn

  • Introduction to Supervised Fine-Tuning (SFT): Gain a solid understanding of the principles behind SFT and its importance in tailoring state-of-the-art language models to specific tasks.

  • Exploring Tiny Llama 1.1B: Delve into the architecture and features of the Tiny Llama 1.1B model and discover its role in the AI ecosystem.

  • Dataset Preparation with Dolly 15k: Learn how to prepare and preprocess the Dolly 15k record dataset to ensure your fine-tuning process is seamless and efficient.

  • HuggingFace Transformers Library: Get hands-on experience with the HuggingFace library, learning how to load models onto a GPU and prepare your training environment.

  • Training Setup and Execution: Walk through the steps to set up and execute the fine-tuning process using Google Colab with a focus on practical implementation.

  • Performance Evaluation: Learn how to compute accuracy and evaluate your model's performance, using metrics to ensure your SFT efforts are effective.

  • Real-World Application: Translate your new skills to real-world problems, understanding how to adapt your fine-tuned model to various domains.


Model Used: TinyLlama-1.1B-intermediate-step-1431k-3T

Dataset Used: databricks-dolly-15k


Who This Course is For

  • Data Scientists and Machine Learning Engineers seeking to specialize in NLP and instruction tuning.

  • AI Practitioners looking to implement and scale fine-tuned language models for industry applications.

  • Software Developers eager to enhance applications with sophisticated language understanding capabilities.

  • Students and Academics desiring hands-on experience with state-of-the-art AI fine-tuning techniques.

Prerequisites

  • Proficiency in Python and familiarity with machine learning and NLP concepts.

  • Experience with neural network frameworks, preferably PyTorch, as used by the HuggingFace Transformers library.

  • A Google account to access Google Colab for hands-on exercises.

Who this course is for:

  • This course a basic level of machine learning knowledge. The user should understand the basics of forward and backward passes. Basic to intermediate Python level is also assumed. The user is also assumed to have a Google Colab account.