Efficient Fine-Tuning for Llama 2 on Custom Dataset with QLoRA on a Single GPU in Google Colab

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ค. 2024
  • In this video, I will show you how to fine-tune a Llama 2 model on a custom dataset. First, we will build a custom dataset using techniques to remove duplicates and the number of tokens. Then, we will fine-tune the Llama 2 model on the custom dataset. Later, we will evaluate the fine-tune Llama 2 model and we will push the fine-tune Llama 2 model on the hugging face hub.
    👉 Complete Code:
    github.com/MuhammadMoinFaisal...
    If you enjoyed this video, be sure to subscribe and press the 👍 button
    _______________________________________________________________
    🧑🏻‍💻 My AI and Computer Vision Courses⭐:
    📙 YOLOv9: Learn Object Detection, Tracking with WebApps (13$):
    www.udemy.com/course/yolov9-l...
    📕 Learn LangChain: Build #22 LLM Apps using OpenAI & Llama 2 (14$):
    www.udemy.com/course/learn-la...
    📚 Computer Vision Web Development: YOLOv8 and TensorFlow.js (13$):
    www.udemy.com/course/computer...
    📕 Learn OpenCV: Build # 30 Apps with OpenCV, YOLOv8 & YOLO-NAS (13$):
    www.udemy.com/course/learn-op...
    📗 YOLO-NAS, OpenAI, SAM with WebApps using Flask and Streamlit (13$): www.udemy.com/course/yolo-nas...
    📘 YOLO-NAS The Ultimate Course for Object Detection & Tracking (13$): www.udemy.com/course/yolo-nas...
    📙 YOLOv8: Object Detection, Tracking & Web Apps in Python 2023 (13$) : www.udemy.com/course/yolov8-t...
    📚 YOLOv7 YOLOv8 YOLO-NAS: Object Detection, Tracking & Web Apps in Python 2023 (13$): www.udemy.com/course/yolov7-o...
    _______________________________________________________________
    Don't forget to connect with me:
    👉 LinkedIn: / muhammad-moin-7776751a0
    🤖 GitHub: github.com/MuhammadMoinFaisal
    _______________________________________________________________
    ⚒️Freelance Work:
    www.upwork.com/freelancers/~0...
    _______________________________________________________________
    For Consultation Call 📞:
    www.upwork.com/freelancers/~0...
    Happy Coding!
    ⌛Time Stamps⏳
    Introduction: 00:00
    Create Dataset : 02:13
    Fine-Tune Llama 2 Model on Custom Data: 28:34
    Evaluate the Fine-Tune Llama 2 Model : 50:15
    Push the Fine-Tune Llama 2 model on the hugging face hub: 54:23
    Tags:
    #Llama2 #Llama #finetune #llms
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 21

  • @muhammadmoinfaisal
    @muhammadmoinfaisal  7 หลายเดือนก่อน +1

    🧑🏻‍💻 My AI and Computer Vision Courses⭐:
    📙 YOLOv9: Learn Object Detection, Tracking with WebApps (13$):
    www.udemy.com/course/yolov9-learn-object-detection-tracking-with-webapps/?couponCode=JUNE13DOLLARS
    📕 Learn LangChain: Build #22 LLM Apps using OpenAI & Llama 2 (14$):
    www.udemy.com/course/learn-langchain-build-12-llm-apps-using-openai-llama-2/?couponCode=JUNE13DOLLARS
    📚 Computer Vision Web Development: YOLOv8 and TensorFlow.js (13$):
    www.udemy.com/course/computer-vision-web-development/?couponCode=JUNE13DOLLARS
    📕 Learn OpenCV: Build # 30 Apps with OpenCV, YOLOv8 & YOLO-NAS (13$):
    www.udemy.com/course/learn-opencv-build-30-apps-with-opencv-yolov8-yolo-nas/?couponCode=JUNE13DOLLARS
    📗 YOLO-NAS, OpenAI, SAM with WebApps using Flask and Streamlit (13$): www.udemy.com/course/yolo-nas-object-detection-tracking-web-app-in-python-2023/?couponCode=JUNE13DOLLARS
    📘 YOLO-NAS The Ultimate Course for Object Detection & Tracking (13$): www.udemy.com/course/yolo-nas-the-ultimate-course-for-object-detection-tracking/?couponCode=JUNE13DOLLARS
    📙 YOLOv8: Object Detection, Tracking & Web Apps in Python 2023 (13$) : www.udemy.com/course/yolov8-the-ultimate-course-for-object-detection-tracking/?couponCode=JUNE13DOLLARS
    📚 YOLOv7 YOLOv8 YOLO-NAS: Object Detection, Tracking & Web Apps in Python 2023 (13$): www.udemy.com/course/yolov7-object-detection-tracking-with-web-app-development/?couponCode=JUNE13DOLLARS

  • @medhavimonish41
    @medhavimonish41 6 หลายเดือนก่อน

    perfect tutorial bro, you covered everything one needs to finetune. thanks

  • @HamzaKhan-zj6dn
    @HamzaKhan-zj6dn 5 หลายเดือนก่อน

    Bhai....you are ultimate man.....so precise and perfectly explained...loved it....

  • @allindiachannel2290
    @allindiachannel2290 6 หลายเดือนก่อน

    Bro you are great keep doing it

  • @user-hg4hg5ix7f
    @user-hg4hg5ix7f 7 หลายเดือนก่อน

    great content. up to you of course but it would be more than appreciated if you could release a video soon or late on different models like mistral and even more interesting would be how to train models based on different kind of dataset and usecases like for example train models for personality or characters. looking forward for more content like this ! good job

    • @muhammadmoinfaisal
      @muhammadmoinfaisal  7 หลายเดือนก่อน

      Tutorial on Fine Tuning Mistral model will be coming next week surely
      Thanks

  • @khalidal-reemi3361
    @khalidal-reemi3361 7 หลายเดือนก่อน +1

    Great Tutorial as usual.
    I liked the details and specificity during the explanation.
    Can you make another code version to use local vector store like chromadb instead of any online one like faiss.

    • @muhammadmoinfaisal
      @muhammadmoinfaisal  7 หลายเดือนก่อน

      Sure will make one tutorial on it as well

  • @allindiachannel2290
    @allindiachannel2290 6 หลายเดือนก่อน

    Bro in the dataset i need to add few row to finetune how can i achieve that please help

  • @chandank5266
    @chandank5266 7 หลายเดือนก่อน

    Really helpful video. I have one doubt, if the context size was 4096 token then why did we choose 2048 for filtering.

    • @kyledinh8369
      @kyledinh8369 7 หลายเดือนก่อน

      4096 is the total context size, headroom is needed for the preamble/prompt template. Such has the “###Instruction …..” that is added after the dataset is k filtered.
      In a real example, the {system_prompt} may vary to examples like “Act as a naval expert and …..”
      base datasets are left generic so they can be used to train different models, which can have very different prompt templates
      and you have to add the token length of the output/response

  • @aiantt
    @aiantt 3 หลายเดือนก่อน

    How to make chatbot with the saved LLAMA-2 model

  • @randomthoughts7838
    @randomthoughts7838 4 หลายเดือนก่อน

    Hey, can you list out some sources for LLMops

  • @user-gp5ee3pr3d
    @user-gp5ee3pr3d 5 หลายเดือนก่อน

    can i run this code withotu colab is visual studio code?

  • @mohamednayeem2602
    @mohamednayeem2602 6 หลายเดือนก่อน

    Hi bro,
    I have certain doubts can you help me out ?

  • @zeroinvader7509
    @zeroinvader7509 7 หลายเดือนก่อน +2

    Can you make a video on how to use such fine tuned models by making an API reference as if we download the model streamlit apps do not have that much space at backend. If I am not wrong we might need to make a quantized version of this model and then use it with our use case by making an API reference as it's size exceeds(13gb >10gb) and we might need to pay for deployment.

    • @muhammadmoinfaisal
      @muhammadmoinfaisal  7 หลายเดือนก่อน

      Sure, will make a video tutorial on it
      Thanks

  • @ccerquei
    @ccerquei 5 หลายเดือนก่อน

    UserWarning: The generation config instance is invalid -- `.validate()` throws warnings and/or exceptions.
    ****Fix these issues to save the configuration. This warning will be raised to an exception in v4.34.****
    Thrown during validation:
    `do_sample` is set to `False`. However, `temperature` is set to `0.9` -- this flag is only used in sample-based generation modes. You should set `do_sample=True` or unset `temperature`.
    warnings.warn(

  • @GauravPal-pd9rf
    @GauravPal-pd9rf 4 หลายเดือนก่อน

    Explaination is good, but losing the gist, no control over data since it is taken from the HF. Asking generic question which can be answered by any text generation engine. I want someone to create a video completely from scratch first by creating the custom dataset step by step (which is partially cover in this video), and feed the LLM and ask questions against the dataset and show the reference of the generated text from the dataset.