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

  Рет қаралды 83,746

Krish Naik

Krish Naik

Күн бұрын

In thsi video we will be dicussing about how we can fien tune LLAMA 2 model with custom dataset using parameter efficient Transfer Learning using LoRA :Low-Rank Adaptation of Large Language Models.
Code: drive.google.com/file/d/1Bd7c...
-------------------------------------------------------------------------------------------------
Support me by joining membership so that I can upload these kind of videos
/ @krishnaik06
-----------------------------------------------------------------------------------
►AWS Bedrock Playlist: • Generative AI In AWS-A...
►Llamindex Playlist: • Announcing LlamaIndex ...
►Google Gemini Playlist: • Google Is On Another L...
►Langchain Playlist: • Amazing Langchain Seri...
►Data Science Projects:
• Now you Can Crack Any ...
►Learn In One Tutorials
Statistics in 6 hours: • Complete Statistics Fo...
End To End RAG LLM APP Using LlamaIndex And OpenAI- Indexing And Querying Multiple Pdf's
Machine Learning In 6 Hours: • Complete Machine Learn...
Deep Learning 5 hours : • Deep Learning Indepth ...
►Learn In a Week Playlist
Statistics: • Live Day 1- Introducti...
Machine Learning : • Announcing 7 Days Live...
Deep Learning: • 5 Days Live Deep Learn...
NLP : • Announcing NLP Live co...
---------------------------------------------------------------------------------------------------
My Recording Gear
Laptop: amzn.to/4886inY
Office Desk : amzn.to/48nAWcO
Camera: amzn.to/3vcEIHS
Writing Pad:amzn.to/3OuXq41
Monitor: amzn.to/3vcEIHS
Audio Accessories: amzn.to/48nbgxD
Audio Mic: amzn.to/48nbgxD

Пікірлер: 117
@kalyandey5195
@kalyandey5195 4 ай бұрын
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!!
@shivashankarmrampur8800
@shivashankarmrampur8800 4 ай бұрын
Can you please share the link of book if you have
@VivekPatel-sj3up
@VivekPatel-sj3up 3 ай бұрын
Book name??
@mysticlunala8020
@mysticlunala8020 3 ай бұрын
@@VivekPatel-sj3up He literally told the book name. Are you guys blind?
@omarhalabi889
@omarhalabi889 3 ай бұрын
have some manners @@mysticlunala8020
@headhunterlovish5111
@headhunterlovish5111 2 ай бұрын
Can U please send me the book or link for it
@zulaysolis5145
@zulaysolis5145 3 ай бұрын
Wow thanks for breaking it down step by step.
@shakilkhan4306
@shakilkhan4306 4 ай бұрын
I started my fine tuning journeys , hope it would be something interesting
@AbdullahiAhmad-Babura
@AbdullahiAhmad-Babura 4 ай бұрын
Amazing following for a long time you are doing well
@DataDorz
@DataDorz 4 ай бұрын
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.
@bluelightning5350
@bluelightning5350 4 ай бұрын
Please make vidoes on theoretical concepts such as LLM model internals, Mixture of Experts, RLHF and so on.
@rishiraj2548
@rishiraj2548 4 ай бұрын
👍
@VivekPatel-sj3up
@VivekPatel-sj3up 3 ай бұрын
+1
@saqibmumtaz9380
@saqibmumtaz9380 Ай бұрын
+1
@pedroluisbroca204
@pedroluisbroca204 3 ай бұрын
This guy's excitement for NLP is adorable but man needs to get out more, the real world is calling!
@arri5812
@arri5812 4 ай бұрын
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
@rishijain8231
@rishijain8231 4 ай бұрын
Amazing video! Can you please make a video on the theoretical aspects as well?
@avanthikar2608
@avanthikar2608 4 ай бұрын
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
@sajidchoudhary1165
@sajidchoudhary1165 4 ай бұрын
Yes, please make a theoretical video as well on all open source llms
@AngelBautistaMartinez
@AngelBautistaMartinez 3 ай бұрын
Mistral's medium posts helped me a ton, then found enterprise for hands on work
@otakudnp3880
@otakudnp3880 2 ай бұрын
does mistral have a medium page? but finding it
@saqibmumtaz9380
@saqibmumtaz9380 Ай бұрын
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.
@vsneelesh3692
@vsneelesh3692 4 ай бұрын
need a theory content also sir . I would help in making the foundations stronger
@oxydol3456
@oxydol3456 Ай бұрын
it's working as charm wow.
@user-zm7gq2lz1s
@user-zm7gq2lz1s 4 ай бұрын
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
@ramankhanna9526
@ramankhanna9526 Ай бұрын
thanks for the video , it would be better if u can show documentation side by side with ur testing plz
@Abdullah_kwl
@Abdullah_kwl 4 ай бұрын
Make theocratical videos on PEFT, LoRA, QLoRA, how quantization work, how quantize a model and Mixture of experts works
@sanjaykrish8719
@sanjaykrish8719 Ай бұрын
You are a gem ❤❤
@markandsweep
@markandsweep 3 ай бұрын
Thanks Krish
@nasiksami2351
@nasiksami2351 4 ай бұрын
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
@anushareddygudipati5169
@anushareddygudipati5169 3 ай бұрын
Amazing! Can you please make video on how to use fine tuned model in RAG.
@KumR
@KumR 4 ай бұрын
waiting for the ollama video buddy
@bikramsubedi3456
@bikramsubedi3456 8 күн бұрын
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??
@sanadasaradha8638
@sanadasaradha8638 4 ай бұрын
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
@PranavBaviskar
@PranavBaviskar Ай бұрын
Thanks for the video. Could you please create an end-to-end implementation video where you use Streamlit and local CPU?
@akandesoji3580
@akandesoji3580 4 ай бұрын
Amazing how did you know all this sir😢😢😢😢
@ssen081
@ssen081 4 ай бұрын
Please conduct sessions on running AI models on cloud platforms like AWS, Azue and Google
@VijayKumar-ib3qc
@VijayKumar-ib3qc 4 ай бұрын
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?
@sanadasaradha8638
@sanadasaradha8638 4 ай бұрын
Sir do a video on how to transfer the customer data into q&a format for fine tuning to llms
@A.M.8181
@A.M.8181 4 ай бұрын
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
@dibyanshuchatterjee4126
@dibyanshuchatterjee4126 3 ай бұрын
Can you please make a video on DPO fine tuning method and its implementation.
@vinayyadav6522
@vinayyadav6522 4 ай бұрын
Hi Krish, Please make a complete video of bedrock llama2 chat further steps for providing the output as API to the front-end or to check on postman by passing inputs and inference parameters using fastapi or Django.
@wasimmemon2284
@wasimmemon2284 3 ай бұрын
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?
@flyingsnow1357
@flyingsnow1357 4 ай бұрын
Can we do fine tuning on unsupervised data?
@ruiteixeira2324
@ruiteixeira2324 2 ай бұрын
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.
@user-rv9rn3ux9v
@user-rv9rn3ux9v 3 ай бұрын
Good tutorial!
@divyagarh
@divyagarh 3 ай бұрын
Thanks for uploading! how to create the dataset from your HTML/PDF content to train the model?
@aravindraamasamy9453
@aravindraamasamy9453 4 ай бұрын
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 4 ай бұрын
Krish Naik please discuss how to evaluate the model ?
@prashantagarwal4570
@prashantagarwal4570 2 ай бұрын
@Krish- After done fine tuning of the model, how can I run the fine-tuned model on local machine
@ArunkumarMTamil
@ArunkumarMTamil Ай бұрын
how is Lora fine-tuning track changes from creating two decomposition matrix? How the ΔW is determined?
@vishalaiml1649
@vishalaiml1649 2 ай бұрын
Hi Krishnaik, can you please create a Series on securing LLM responses, and Guardrails as it is burning topic now a days. Sincere Request.
@coldedkiller1125
@coldedkiller1125 4 ай бұрын
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 ?
@ashish_sinhrajput5173
@ashish_sinhrajput5173 3 ай бұрын
what modification i need to do i i wanted to fine-tune this llama model on text-Summarization task... ?
@tirthbhatt3340
@tirthbhatt3340 4 ай бұрын
Hello krish could you please make videos on Auto gen?
@fl028
@fl028 28 күн бұрын
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!
@tirthbharatiya2611
@tirthbharatiya2611 4 ай бұрын
hey Krish, why I'm not able to see course request form on TechNeuron and why there is no new content?
@CosmosTraveler8008
@CosmosTraveler8008 2 ай бұрын
Sir can you create videos for evaluation of LLMs
@TheAmazonExplorer731
@TheAmazonExplorer731 4 ай бұрын
Please make a vido with demo that robot perform task using LLM
@rahulhiware4049
@rahulhiware4049 3 ай бұрын
@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)
@user-bl4wn6cr2i
@user-bl4wn6cr2i 3 ай бұрын
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
@pranabsingharoy3270
@pranabsingharoy3270 4 ай бұрын
Why you are train for 1 epoch only? What will be the optimal number of epochs?
@user-vo5ce6kn5t
@user-vo5ce6kn5t 4 ай бұрын
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 .
@user-xo3cu7nq1z
@user-xo3cu7nq1z 4 ай бұрын
from where did you learn ? can you share some resources , so that i can learn all of these from one place ?
@shaikirfanrahim7334
@shaikirfanrahim7334 4 ай бұрын
Please make video on oneDNN
@SyafieWork
@SyafieWork Ай бұрын
If I am using langchain, can i still use this method?
@gokulraj6633
@gokulraj6633 4 ай бұрын
Will the same code work for llama 13b chat . If not can you share Collab for fine tuning llama 13b .
@AppleFlickFix
@AppleFlickFix Ай бұрын
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?
@ravikumar46931
@ravikumar46931 4 ай бұрын
Can we train this model locally by creating a virtual environment (e.g. conda) ?
@ashishmehra5143
@ashishmehra5143 4 ай бұрын
It is possible but you need a very high VRAM to process.
@gideongyimah217
@gideongyimah217 4 ай бұрын
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 4 ай бұрын
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.
@yajuvendra15
@yajuvendra15 3 ай бұрын
Hello Krish, May I know how can we deploy this as an app in a kubernetis enviroment. thanks
@nimesh.akalanka
@nimesh.akalanka Ай бұрын
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?
@somtirthadas9347
@somtirthadas9347 3 ай бұрын
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?
@Hizar_127
@Hizar_127 2 ай бұрын
I have a 50k sample dataset i want to fine tune the model.. can i do with this code ??
@sanjanakumar7525
@sanjanakumar7525 2 ай бұрын
Can you please update the link to the code? The one given in the description does not work anymore
@raghuvallikkat3384
@raghuvallikkat3384 2 ай бұрын
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
@TechKnowledgeForYou780
@TechKnowledgeForYou780 2 ай бұрын
Hi Sir, Thanks for the information. Could you please share that pdf(Parameter - Efficient Transform learning for NLP).
@user-lp3me7kf1w
@user-lp3me7kf1w 4 ай бұрын
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.
@azkarathore4355
@azkarathore4355 8 күн бұрын
Can we finetune llama3 model for machine translation task
@mayankmaurya9990
@mayankmaurya9990 3 ай бұрын
Hi krish, If I have client data and don't want to load from huggingface then How can I do this?
@dipali5562
@dipali5562 2 ай бұрын
buy 4bit quantization don't u think we will be loosing information ?
@Mintusir9
@Mintusir9 4 ай бұрын
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 4 ай бұрын
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 4 ай бұрын
@@ashishmehra5143 you can do this project then please make a video
@user-wj4ce4gi6n
@user-wj4ce4gi6n 4 ай бұрын
Can we use this for other languages such as Arabic Thanks a lot!!
@krishnaik06
@krishnaik06 4 ай бұрын
Yes u can
@sanket9871
@sanket9871 Ай бұрын
How can I save the fine tuned model locally?
@jadedboy-kx3vm
@jadedboy-kx3vm Ай бұрын
How can i get my model in gguf format?
@user-xn3ir2yc6m
@user-xn3ir2yc6m 2 ай бұрын
hi everyone, can anyone help very quickly print(res[0]['generated_text']). it gives us both input and output. is there anyway i can get only output result?
@sumayyaafreen3499
@sumayyaafreen3499 3 ай бұрын
Can we use LLAMA for urdu language applications?
@sayantikachatterjee5032
@sayantikachatterjee5032 Ай бұрын
why we set fp16=False, bf16=False in training_arguments = TrainingArguments() ?
@nareshmalviya3100
@nareshmalviya3100 25 күн бұрын
When i load the model. I facing error config.json not appear. And my model saved adapter_config.json Please provide solution.......
@vijaydas2962
@vijaydas2962 4 ай бұрын
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 ??
@vidhanrathore2296
@vidhanrathore2296 2 күн бұрын
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............
@lixiasong3459
@lixiasong3459 4 ай бұрын
Sir, can I run the code on my local vs code?
@ashishmehra5143
@ashishmehra5143 4 ай бұрын
Yes if your local compute has enough processing power to run it.
@FuzzyLab
@FuzzyLab 2 ай бұрын
How i can pass my model to .gruff ?
@rohanpandey9957
@rohanpandey9957 4 ай бұрын
need a whole playlist on llms sir
@pratibhagoudar6817
@pratibhagoudar6817 4 ай бұрын
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🌹
@user-vo5ce6kn5t
@user-vo5ce6kn5t 4 ай бұрын
you should change your google Colab memory runtime
@pratibhagoudar6817
@pratibhagoudar6817 4 ай бұрын
@@user-vo5ce6kn5ti have worked with it's T4 gpu.. Do i need to change to another runtime?
@abduljalilhassan1798
@abduljalilhassan1798 4 ай бұрын
We are still waiting for theoretical part
@enough200
@enough200 4 ай бұрын
why dont you explain the theory also
@krishnaik06
@krishnaik06 4 ай бұрын
Next video
@k4f
@k4f 3 ай бұрын
This video makes my LoRA hard
@explorewithshiljoy
@explorewithshiljoy 4 ай бұрын
Apologies, but upon viewing your video, I found the explanation lacking. It's crucial to have a strong initial explanation, especially when presenting more intricate concepts like fine tuning.
@sparkledark3713
@sparkledark3713 2 ай бұрын
He said it's an overview. Just a rundown before starting the video:
@user-mi3zv2jd6i
@user-mi3zv2jd6i 4 ай бұрын
CaSUal nhi sir ji....CaUSal...!!!
@agrawal1207
@agrawal1207 3 ай бұрын
The video was just to show off your knowledge, it wasn't a tutorial to anything
@snehitvaddi
@snehitvaddi 2 ай бұрын
Hey! Facing this issue with Langcahin loader: AttributeError: module 'numpy.linalg._umath_linalg' has no attribute '_ilp64' Literally dying to resolve this. Please help
Fine-tune Gemma models With Custom Data in Keras using LoRA
18:01
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 4,4 МЛН
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 69 МЛН
Whyyyy? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 20 МЛН
Children deceived dad #comedy
00:19
yuzvikii_family
Рет қаралды 3,3 МЛН
LoRA & QLoRA Fine-tuning Explained In-Depth
14:39
Entry Point AI
Рет қаралды 27 М.
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
pixegami
Рет қаралды 116 М.
Understanding How Vector Databases Work!
12:25
The ML Tech Lead!
Рет қаралды 13 М.
AI VS ML VS DL VS Data Science
9:45
Krish Naik
Рет қаралды 2,8 МЛН
TensorFlow in 100 Seconds
2:39
Fireship
Рет қаралды 897 М.
Building Production-Ready RAG Applications: Jerry Liu
18:35
AI Engineer
Рет қаралды 269 М.
Generative AI Fine Tuning LLM Models Crash Course
2:36:50
Krish Naik
Рет қаралды 28 М.
Things Required To Master Generative AI- A Must Skill In 2024
15:01
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 4,4 МЛН