Steps By Step Tutorial To Fine Tune LLAMA 2 With Custom Dataset Using LoRA And QLoRA Techniques

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ • 137

  • @kalyandey5195
    @kalyandey5195 10 місяців тому +31

    Amazing !!! I have red the book -"Generative AI on AWS" today and learnt all the concepts of quantization, PEFT, LoRA, QLoRA and you have uploaded the video for the same!! Thanks a lot!!

  • @bluelightning5350
    @bluelightning5350 10 місяців тому +43

    Please make vidoes on theoretical concepts such as LLM model internals, Mixture of Experts, RLHF and so on.

  • @shakilkhan4306
    @shakilkhan4306 10 місяців тому +8

    I started my fine tuning journeys ,
    hope it would be something interesting

  • @pedroluisbroca204
    @pedroluisbroca204 9 місяців тому +5

    This guy's excitement for NLP is adorable but man needs to get out more, the real world is calling!

  • @nasiksami2351
    @nasiksami2351 10 місяців тому +6

    Thank you for the video. The main issue I face from these tutorials is the custom dataset preparation part. Here also the dataset is loaded from HF.
    I have a tabular NLP classification dataset in my local. Let's say sentiment analysis dataset.
    How should I prepare the dataset and run the llm finetuning locally?
    Thank you again for this tutorial. I hope you'll show us the implementation of actual local, own dataset finetuning.
    Also, there's a paper called TabLLM, which uses LLM on numeric tabular datasets. Making a video on that one would be so much helpful regarding implementing it on the custom private dataset. Thank you again, and keep bringing good content as always

    • @HSM2727
      @HSM2727 Місяць тому

      read this paper: Unleashing the Potential of Large Language Models
      for Predictive Tabular Tasks in Data Science

  • @DataDorz
    @DataDorz 10 місяців тому +7

    Amazing video Krish, Can you also make a video on how to build RAG based LLM for Q&A over multiple documents where we can actually compare between two or more documents.

  • @zulaysolis5145
    @zulaysolis5145 10 місяців тому

    Wow thanks for breaking it down step by step.

  • @AbdullahiAhmad-Babura
    @AbdullahiAhmad-Babura 10 місяців тому +1

    Amazing following for a long time you are doing well

  • @avanthikar2608
    @avanthikar2608 10 місяців тому +2

    Can you please upload videos indepth of how different prompting techniques like chain of thought, self consistency, knowledge generation etc were practically used with which the outputs of the models based on use cases are getting improved

  • @Abdullah_kwl
    @Abdullah_kwl 10 місяців тому +1

    Make theocratical videos on PEFT, LoRA, QLoRA, how quantization work, how quantize a model and Mixture of experts works

  • @AngelBautistaMartinez
    @AngelBautistaMartinez 9 місяців тому

    Mistral's medium posts helped me a ton, then found enterprise for hands on work

    • @otakudnp3880
      @otakudnp3880 8 місяців тому

      does mistral have a medium page?
      but finding it

  • @Timeless_Stoic
    @Timeless_Stoic 10 місяців тому +3

    Amazing how did you know all this sir😢😢😢😢

  • @sanadasaradha8638
    @sanadasaradha8638 10 місяців тому +2

    Actually this the video i want to ask you but you read my mind before I ask that why I am saying now Krish sir is mind reader

  • @sajidchoudhary1165
    @sajidchoudhary1165 10 місяців тому +1

    Yes, please make a theoretical video as well on all open source llms

  • @paul-andrejacques2488
    @paul-andrejacques2488 5 місяців тому

    Very Amazing video. Please make vidoes using json or csv file as a dataset

  • @arri5812
    @arri5812 10 місяців тому

    thank you sir for this video, please make videos on theortical concepts needed to understand this fine tuning process. It will mean alot thanks sir

  • @ruiteixeira2324
    @ruiteixeira2324 9 місяців тому +1

    May I ask a question? I used your code to fine-tune llama2 7b-chat on my data and the code works perfectly, but for some reason my new LLM can't predict the EOS token. So, every time I ask the model to generate text, it will generate tokens until it reaches the max_length. I think there is something wrong with the way Lora is using this EOS token. Do you have any idea how to fix this?
    By the way, amazing video. Thanks.

  • @bikramsubedi3456
    @bikramsubedi3456 6 місяців тому

    for tuning this model the format of dataset must be same or i may use any others format too such as row with text only without and [INST] or if labelled data are required then i use csv with two rows for prompt and answer??

  • @saqibmumtaz9380
    @saqibmumtaz9380 7 місяців тому

    Please also make a video on mathematical concepts and the intuition behind the LLMs.
    Already subscribed and liked the video, as you are doing an amazing job.

  • @A.M.8181
    @A.M.8181 10 місяців тому

    Can you tell me what dataset templates should be used for fine-tuning? What fields should be there? If I need the model to answer questions in chat mode, like a first-line support bot, make a summary of the text I insert - are these different sets and as a result different models? That is, it turns out that I need already 2 models, each solves a specific task? If, for example, there is a production department and a financial department in the company, then is it better to use 2 separate small models and they are tailored to a separate knowledge sphere or use one large one? Show how to fine-tune on a local computer in the VSC environment on an RTX4090 video card

  • @ramankhanna9526
    @ramankhanna9526 7 місяців тому

    thanks for the video , it would be better if u can show documentation side by side with ur testing plz

  • @sanjaykrish8719
    @sanjaykrish8719 7 місяців тому

    You are a gem ❤❤

  • @janarddansarkar3447
    @janarddansarkar3447 6 місяців тому

    Could you please explain the parameters, what does they mean, what is the effect of these in the model performance and what is the significance etc. ?? In interviews, they ask such questions only, because almost all the candidates has a lot of project from various online resources, but we need the underneath principle behind the working of finetuning with different params.

  • @vsneelesh3692
    @vsneelesh3692 10 місяців тому

    need a theory content also sir . I would help in making the foundations stronger

  • @rahulhiware4049
    @rahulhiware4049 9 місяців тому

    @Krish Can you load the fine-tuned model and then test/check it on the test data? In last code snippet I guess you are using the base model to get the results. Please correct me if I am wrong.
    Coping that line of code here which I am doubtful of.
    pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200)

    • @KushagraKumar-s1g
      @KushagraKumar-s1g 9 місяців тому

      I have the same doubts. It seems it is picking the old base model and not the fined-tune one. Correct me if I am wrong

  • @rishijain8231
    @rishijain8231 10 місяців тому

    Amazing video! Can you please make a video on the theoretical aspects as well?

  • @fl028
    @fl028 7 місяців тому

    Hi everyone,
    I have a question about data preparation and fine tuning of LLMs. What should the data format look like in the fine tuning process? On the one hand, it can be pure text to add special knowledge to the LLM. On the other hand, the data set can be structured in question and answer / prompt and answer format.
    What do you think? Do you have any recommendations for me?
    Thank you and best regards!

  • @anushareddygudipati5169
    @anushareddygudipati5169 9 місяців тому

    Amazing! Can you please make video on how to use fine tuned model in RAG.

  • @vigneshkannam1655
    @vigneshkannam1655 Місяць тому

    You are doing good, but still pls explain technical points more and reduce repeated sentences

  • @praffulvyas-m7f
    @praffulvyas-m7f 10 місяців тому

    Thank you for this amazing video. Can u also explain how to create custom dataset in Q/A format from the raw text and fine tune it and should we fine tune or use RAG if we want reponse from a particular domain only.Thanks

  • @wasimmemon2284
    @wasimmemon2284 9 місяців тому

    Hi Krish, I had a doubt:
    Will quantization decrease the accuracy of the whole model? Will that mean that we will get less accurate results?

  • @PranavBaviskar
    @PranavBaviskar 8 місяців тому

    Thanks for the video. Could you please create an end-to-end implementation video where you use Streamlit and local CPU?

  • @ssen081
    @ssen081 10 місяців тому

    Please conduct sessions on running AI models on cloud platforms like AWS, Azue and Google

  • @sathiyalokeswaranlingeswar5062
    @sathiyalokeswaranlingeswar5062 3 місяці тому

    great tutorial

  • @sanadasaradha8638
    @sanadasaradha8638 10 місяців тому +1

    Sir do a video on how to transfer the customer data into q&a format for fine tuning to llms

  • @AbhishekChaudhary-y5f
    @AbhishekChaudhary-y5f 3 місяці тому

    Krish sir, can you tell me for fine tunning llama 3 why most of the people are using alpaca format, is this a straight away rule, or it just like it works well with alpaca format for fine-tunning.

  • @ravikumar46931
    @ravikumar46931 10 місяців тому +1

    Can we train
    this model locally by creating a virtual environment (e.g. conda) ?

    • @ashishmehra5143
      @ashishmehra5143 10 місяців тому

      It is possible but you need a very high VRAM to process.

  • @oxydol3456
    @oxydol3456 7 місяців тому

    it's working as charm wow.

  • @ArunkumarMTamil
    @ArunkumarMTamil 8 місяців тому

    how is Lora fine-tuning track changes from creating two decomposition matrix? How the ΔW is determined?

  • @coldedkiller1125
    @coldedkiller1125 10 місяців тому

    Sir this is a great video, but Please give a method that dont use hugging face to download the model, because we may have to train the same model again with new data. Also in the video we have download the model but how to load the model if it is locally available ?

  • @JaykishanMoradiya-b8p
    @JaykishanMoradiya-b8p 2 місяці тому

    Can we fintune the .GGUF model direcly by this way without any quantization process?
    Llama-3.2-1B-Instruct-Q4_K_S.gguf
    want to fine-tune the above model based on specific requirements for local devices.

  • @vishalaiml1649
    @vishalaiml1649 8 місяців тому

    Hi Krishnaik, can you please create a Series on securing LLM responses, and Guardrails as it is burning topic now a days. Sincere Request.

  • @ashish_sinhrajput5173
    @ashish_sinhrajput5173 9 місяців тому +1

    what modification i need to do i i wanted to fine-tune this llama model on text-Summarization task... ?

  • @AngelYahirHernàndezGarcìa
    @AngelYahirHernàndezGarcìa 10 місяців тому

    Good tutorial!

  • @KumR
    @KumR 10 місяців тому

    waiting for the ollama video buddy

  • @divyagarh
    @divyagarh 10 місяців тому

    Thanks for uploading! how to create the dataset from your HTML/PDF content to train the model?

  • @kuldeepism
    @kuldeepism 5 днів тому

    over here ;)

  • @flyingsnow1357
    @flyingsnow1357 10 місяців тому +2

    Can we do fine tuning on unsupervised data?

  • @Iampercey
    @Iampercey 9 місяців тому

    @Krish- After done fine tuning of the model, how can I run the fine-tuned model on local machine

  • @dibyanshuchatterjee4126
    @dibyanshuchatterjee4126 9 місяців тому

    Can you please make a video on DPO fine tuning method and its implementation.

  • @MohaKashani
    @MohaKashani 4 місяці тому

    Your google colab code has conflict of packages and can not be run. I suppose just recently something has changed with the hidden package versions and so the problem has raised, or?

  • @pranabsingharoy3270
    @pranabsingharoy3270 10 місяців тому

    Why you are train for 1 epoch only? What will be the optimal number of epochs?

  • @SayaliYadav-h7x
    @SayaliYadav-h7x 10 місяців тому

    I have already run this script one month ago, but this model cannot provide accurate answers as on custom data on which this llama2 model is trained .

  • @gideongyimah217
    @gideongyimah217 10 місяців тому +1

    Can you please upload a video on how to finetune LLM model to work on or understand local language given a dataset on local languages

    • @ashishmehra5143
      @ashishmehra5143 10 місяців тому +1

      Finetuning happens when you cannot train the model for each user or each use case. If you want the model to work in a specific native language, the Llama2 model should have been trained in the same native language. Remember you are training the model with the data and the current Llama2 model is training on the English dataset.

  • @markandsweep
    @markandsweep 10 місяців тому

    Thanks Krish

  • @Shrieenidhi
    @Shrieenidhi 3 місяці тому

    I didn't understand "NousResearch/Llama-2-7b-chat-hf" this part. The original version of this model belongs to "meta-llama/Llama-2-7b-chat-hf". Since you are reducimg the precision, are you using this "NousResearch" model or what's the use in using this model. Also, what's the difference between these two models?

  • @raghuvallikkat3384
    @raghuvallikkat3384 8 місяців тому

    Hi Krish, Hi ,
    I want to fine tune a code generator model with our organisational data specific to embedded Software. code generated should be specific to the chipset we are using. I was thinking of using starcoder/CodeLLAMA as a base model and fine tune with QLORA. But I dont have much clarity of the format in which I should prepare the custom data set. Can you please help on this. Will joining the group with subscription will help to get some 1:1 guidance

  • @Mintusir9
    @Mintusir9 10 місяців тому +1

    Hello sir ❤
    Can you make a welding detection project using AI
    Is it possible to you or not
    If you make then please make

    • @ashishmehra5143
      @ashishmehra5143 10 місяців тому

      You do not need an LLM model for it. Wedding possibility is a classification problem and it is very easy to make a model if you know logistic regression or decision tree algorithm. These are week learners with a low accuracy but your use case is solvable by the said algorithms.

    • @Mintusir9
      @Mintusir9 10 місяців тому

      @@ashishmehra5143 you can do this project then please make a video

  • @tirthbharatiya2611
    @tirthbharatiya2611 10 місяців тому

    hey Krish, why I'm not able to see course request form on TechNeuron and why there is no new content?

  • @Ankit-b8d3s
    @Ankit-b8d3s 10 місяців тому

    from where did you learn ? can you share some resources , so that i can learn all of these from one place ?

  • @aravindraamasamy9453
    @aravindraamasamy9453 10 місяців тому

    I want to integrate my database to the llm model , is it possible to finetune that. Can you show demo for integrating databses and fine tuning the llm model based on it.

  • @abduljalilhassan1798
    @abduljalilhassan1798 10 місяців тому

    Krish Naik please discuss how to evaluate the model ?

  • @AppleFlickFix
    @AppleFlickFix 8 місяців тому

    Hi folks, can anyone help?
    he had taken from the hugging-face for the final demonstration of the output but we need to test the fine-tuned model right?

  • @ابوالقاسم-ن3خ
    @ابوالقاسم-ن3خ 10 місяців тому +1

    Can we use this for other languages such as Arabic Thanks a lot!!

  • @bonguyen3837
    @bonguyen3837 3 місяці тому

    The result you trained is not really matched with the result in the dataset, how do you think?

  • @vijaydas2962
    @vijaydas2962 10 місяців тому

    looks like a typo!! Are we not supposed to be using "new_model" instead of "model" while testing the fine tuned model? I'm referring to this line-----> pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=200). I think correct argument should be --> model=new_model instead of model=model ??

  • @nimesh.akalanka
    @nimesh.akalanka 8 місяців тому

    How can I fine-tune the LLAMA 3 8B model for free on my local hardware, specifically a ThinkStation P620 Tower Workstation with an AMD Ryzen Threadripper PRO 5945WX processor, 128 GB DDR4 RAM, and two NVIDIA RTX A4000 16GB GPUs in SLI? I am new to this and have prepared a dataset for training. Is this feasible?

  • @adanpalma4026
    @adanpalma4026 5 місяців тому

    I m not surw if you said. But what is the avg hardware configuration?

  • @somtirthadas9347
    @somtirthadas9347 9 місяців тому

    RuntimeError: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver. I'm facing this error in google colab while running the GPU compatibility part. What can be the solution?

  • @yajuvendra15
    @yajuvendra15 10 місяців тому

    Hello Krish, May I know how can we deploy this as an app in a kubernetis enviroment. thanks

  • @CosmosTraveler8008
    @CosmosTraveler8008 9 місяців тому

    Sir can you create videos for evaluation of LLMs

  • @gokulraj6633
    @gokulraj6633 10 місяців тому

    Will the same code work for llama 13b chat . If not can you share Collab for fine tuning llama 13b .

  • @tirthbhatt3340
    @tirthbhatt3340 10 місяців тому

    Hello krish could you please make videos on Auto gen?

  • @sayantikachatterjee5032
    @sayantikachatterjee5032 7 місяців тому

    why we set fp16=False,
    bf16=False in training_arguments = TrainingArguments() ?

  • @sanjanakumar7525
    @sanjanakumar7525 9 місяців тому

    Can you please update the link to the code? The one given in the description does not work anymore

  • @TechKnowledgeForYou780
    @TechKnowledgeForYou780 8 місяців тому

    Hi Sir, Thanks for the information. Could you please share that pdf(Parameter - Efficient Transform learning for NLP).

  • @thearyandhar6621
    @thearyandhar6621 27 днів тому

    when I click the google drive link it goes to a pdf with some json...

  • @NIKHILPRASAD-e1g
    @NIKHILPRASAD-e1g 10 місяців тому

    downloaded the dataset and entered my own one prompt template by replacing other, and was not able to achieve the result for it, Kindly help me.

  • @TheAmazonExplorer731
    @TheAmazonExplorer731 10 місяців тому

    Please make a vido with demo that robot perform task using LLM

  • @AbhinavKumar-tx5er
    @AbhinavKumar-tx5er 4 місяці тому +1

    Boss the code link provided in the description is not working

  • @mayankmaurya9990
    @mayankmaurya9990 9 місяців тому

    Hi krish, If I have client data and don't want to load from huggingface then How can I do this?

  • @MasterMan2015
    @MasterMan2015 4 місяці тому

    Does anyone retrain LLma 2 on monolingual data (let's say some data in a sepecific low resource language XX) and then finetune it on parallel data en - XX ?

  • @SyafieWork
    @SyafieWork 8 місяців тому

    If I am using langchain, can i still use this method?

  • @pratibhagoudar6817
    @pratibhagoudar6817 10 місяців тому +1

    Hi krish sir!
    I have worked on this script 2 days back, and I am eagerly waiting for your explanation about this llama.
    And my doubt is that,
    I think you didn't gone through this cell,
    "Reload the fp16 and merge it with lora weights " Explain this code cell and how it will merge and where it could be stored. For this particular block error : I'm getting out of the memory issue .
    And waiting for math's behind peft and theriotical knowledge...
    I hope this comment you will read,,
    And hope for response to my question!!!
    Thank you🌹

    • @SayaliYadav-h7x
      @SayaliYadav-h7x 10 місяців тому

      you should change your google Colab memory runtime

    • @pratibhagoudar6817
      @pratibhagoudar6817 10 місяців тому

      @@SayaliYadav-h7xi have worked with it's T4 gpu.. Do i need to change to another runtime?

  • @sumayyaafreen3499
    @sumayyaafreen3499 9 місяців тому

    Can we use LLAMA for urdu language applications?

  • @Hizar_127
    @Hizar_127 8 місяців тому

    I have a 50k sample dataset i want to fine tune the model.. can i do with this code ??

  • @nareshmalviya3100
    @nareshmalviya3100 7 місяців тому

    When i load the model. I facing error config.json not appear. And my model saved adapter_config.json
    Please provide solution.......

  • @ganeshkumara8501
    @ganeshkumara8501 5 місяців тому

    i created my owndata set with my company data.It is showing wrong answers why?

  • @vidhanrathore2296
    @vidhanrathore2296 6 місяців тому

    Hi Your video is amaizing but I am not able to assess the code can provide me the github link I can utilize it.
    Please please............

  • @azkarathore4355
    @azkarathore4355 6 місяців тому

    Can we finetune llama3 model for machine translation task

  • @s.sanket7
    @s.sanket7 7 місяців тому

    How can I save the fine tuned model locally?

  • @lixiasong3459
    @lixiasong3459 10 місяців тому +1

    Sir, can I run the code on my local vs code?

    • @ashishmehra5143
      @ashishmehra5143 10 місяців тому +1

      Yes if your local compute has enough processing power to run it.

  • @hmlynmusic
    @hmlynmusic 7 місяців тому

    How can i get my model in gguf format?

  • @VijayKumar-ib3qc
    @VijayKumar-ib3qc 10 місяців тому

    Hi Krish,
    Thanks for the video.
    What is the purpose of developing the model using PEFT? Is the objective is to mimic CHATGPT where you ask questions and you get the answer?

  • @shaikirfanrahim7334
    @shaikirfanrahim7334 10 місяців тому

    Please make video on oneDNN

  • @zafrulislamshaik2390
    @zafrulislamshaik2390 2 місяці тому +1

    Hello Sir ,
    This video is very unclear and I watched your mathematics intuition as well

  • @thearyandhar6621
    @thearyandhar6621 27 днів тому

    Where is the link for the notebook???

  • @rohanpandey9957
    @rohanpandey9957 10 місяців тому +1

    need a whole playlist on llms sir

  • @FuzzyLab
    @FuzzyLab 9 місяців тому

    How i can pass my model to .gruff ?

  • @Zerodayy0x00
    @Zerodayy0x00 6 місяців тому

    At the end of the day js permanent 😂