Fine-tuning Llama 2 on Your Own Dataset | Train an LLM for Your Use Case with QLoRA on a Single GPU

  Рет қаралды 121,675

Venelin Valkov

Venelin Valkov

Күн бұрын

Пікірлер: 60
@venelin_valkov
@venelin_valkov 10 ай бұрын
Full text tutorial (requires MLExpert Pro): www.mlexpert.io/prompt-engineering/fine-tuning-llama-2-on-custom-dataset
@kiranatmakuri3710
@kiranatmakuri3710 9 ай бұрын
Can you send me your email pls I have a question can’t ask in public
@williamfussell1956
@williamfussell1956 8 ай бұрын
I keep having problems with the model.merge_and_unload()... It seems to be a bit different from the documentation on Hugging Face...is there something I am missing here? The error says that that 'LlamaForCausalLM' object has no attribute 'merge_and_unload'.... Any ideas?
@pablomeza5932
@pablomeza5932 8 ай бұрын
@@williamfussell1956 Did you fix that?
@fl028
@fl028 4 ай бұрын
@@williamfussell1956 merged_model = trained_model.merge_and_unload()
@christopherbader2222
@christopherbader2222 9 ай бұрын
This is great. A version for question answering would be helpful too.
@echos01
@echos01 10 ай бұрын
Excellent work! You are the hero!
@stawils
@stawils 10 ай бұрын
Good stuff coming, thank you in advance ❤
@parisapouya6716
@parisapouya6716 10 ай бұрын
Awesome work! Thanks a ton!
@HeywardLiu
@HeywardLiu 10 ай бұрын
Awesome tutorial!
@vivekjyotibhowmik8008
@vivekjyotibhowmik8008 10 ай бұрын
Can you provide the Google Collab notebook?
@NitroBrewbell
@NitroBrewbell 10 ай бұрын
very helpful. Thanks for the videos.
@VaibhavPatil-rx7pc
@VaibhavPatil-rx7pc 10 ай бұрын
Super excited
@krishchatterjee2819
@krishchatterjee2819 9 ай бұрын
Excellent video! What changes in the input we need to make to use 8 bit quantization instead of 4 bit. Thanks.
@AbdulBasit-ff6tq
@AbdulBasit-ff6tq 10 ай бұрын
Do you have or plan to make a tutorial for something like bellow? Tutorial for the plane text fine-tuning and then tuning that model to make it an instruct tuned one?
@GregMatoga
@GregMatoga 9 ай бұрын
Thank you for this! Is finetuning a good approach for a private/proprietary documentation Q&A?
@fabsync
@fabsync 2 ай бұрын
Fantastic video! It will be nice to see a full tutorial on how to do it with pdf locally...
@lyovazi8533
@lyovazi8533 10 ай бұрын
very good video
@DawnWillTurn
@DawnWillTurn 10 ай бұрын
Any idea how can we deploy llama-2 on huggingface api? just like the falcon one, has some issue with the handler.
@williamgomezsantana
@williamgomezsantana 5 ай бұрын
Incredible video!! Thank you very much, I have a question: isn't it mandatory to put characters like EOS at the end of the summary? for the LLM to finish the instruction?
@jensonjoy83
@jensonjoy83 10 ай бұрын
will you be able to add a tutorial for llama2-chat model
@experiment5762
@experiment5762 9 ай бұрын
Great!! Do some videos regarding RLHF.
@techtraversal219
@techtraversal219 8 ай бұрын
Thanks for sharing, really helpful. Waiting for my Llama model access to follow it step by step. Can I use any other model in place of this?
@srushtiharyan2033
@srushtiharyan2033 5 ай бұрын
Did you get the access? And how long did it take?
@ikurious
@ikurious 10 ай бұрын
Great video! Is there anyway to build my instruction dataset for instruct fine-tuning from classical text books?
@ikurious
@ikurious 10 ай бұрын
@@user-xt6tu3xt3t but then how to convert in question & answer format?
@mauriciososa9722
@mauriciososa9722 10 ай бұрын
@@ikurious the best way is manualyl by a human
@sasukeuchiha-ck4hy
@sasukeuchiha-ck4hy 10 ай бұрын
can you train the model on german data?
@tarunku9378
@tarunku9378 10 ай бұрын
I still don't get it i have my data locally , how should start finetuning it please tell
@chukypedro818
@chukypedro818 10 ай бұрын
Super🎉
@shopbc5553
@shopbc5553 7 ай бұрын
Do you have an idea how GPT4 is so good with its responses from its base model when I upload documents to it? Could it be the parameter. size only or do you think other technologies are what determine the quality difference?
@tillwill3232
@tillwill3232 Ай бұрын
parameter size and training data i guess? Also I dont think we know their exact network architecture since they didnt release their network publicly, can only access it via product
@GooBello-gr2ls
@GooBello-gr2ls 9 ай бұрын
can i download the finetuned model after finetuning? is it in format .bin or .safetensor or else? cuz im current trying to do finetuning on textgen, but having troubles. with dataset (format) i guess.
@lisab1360
@lisab1360 9 ай бұрын
do you already know how you can download the finetuned model?
@williamfussell1956
@williamfussell1956 8 ай бұрын
Hi there, I am just reading through the repo and Im pretty sure this is the answer...i just wanted to make sure... The actual input to the model is only from the [text] field, is that correct? As the [text] field contains the prompt, the conversation and the summary...
@user-xy5re6qh3d
@user-xy5re6qh3d 7 ай бұрын
Hola, For me the validation log show No log with mistral instruct model. Please help anyone.
@danieladama8105
@danieladama8105 10 ай бұрын
🔥
@vitocorleon6753
@vitocorleon6753 10 ай бұрын
I need help please. I just want to be pointed in the right direction since I'm new to this and since I couldn't really find any proper guide to summarize the steps for what I want to accomplish. I want to integrate a LLama 2 70B chatbot into my website. I have no idea where to start. I looked into setting up the environment on one of my cloud servers(Has to be private). Now I'm looking into training/fine-tuneing the chat model using our data from our DBs(It's not clear for me here but I assume it involves two steps, first I have to have the data in a CSV format since it's easier for me, second I will need to format it in Alpaca or Openassistant formats). After that, the result should be a deployment-ready model ? Just bullet points I'd highly appreciate that.
@vitocorleon6753
@vitocorleon6753 10 ай бұрын
@nty3929 Oh :/ I’m still lost about this but thank you for your effort nevertheless!
@GregMatoga
@GregMatoga 9 ай бұрын
@nty3929 Yeah, bots are ruthless here and youtube is having none of it, even at that cost. Guess they expect to see more technical conversations elsewhere
@elysiryuu
@elysiryuu 5 ай бұрын
Thanks for the insight, is it possible to perform training locally, with 8 GB VRAM?
@stephenmartinez4883
@stephenmartinez4883 3 ай бұрын
No
@karimbaig8573
@karimbaig8573 8 ай бұрын
When you say you are tracking loss, what loss is that and how is that loss calculated for the task (summarization) at hand?
@anuranjankumar2904
@anuranjankumar2904 6 ай бұрын
I have the same question. @karimbaig8573 were you able to figure out the answer?
@karimbaig8573
@karimbaig8573 6 ай бұрын
Nope.
@tahahuraibb5833
@tahahuraibb5833 10 ай бұрын
default_factory=lambda: ["q_proj", "v_proj"] Why did you not add this? Is it because HF does under the hood?
@venelin_valkov
@venelin_valkov 10 ай бұрын
I totally forgot about the `target_modules`. I retrained and updated the notebook/tutorial with those. The results are better! Here's the list: lora_target_modules = [ "q_proj", "up_proj", "o_proj", "k_proj", "down_proj", "gate_proj", "v_proj", ] I composed it from here: github.com/huggingface/transformers/blob/f6301b9a13b8467d1f88a6f419d76aefa15bd9b8/src/transformers/models/llama/convert_llama_weights_to_hf.py#L144 Thank you!
@williamfussell1956
@williamfussell1956 8 ай бұрын
Is there a good resource for understanding 'target modules' for different models? @@venelin_valkov
@cancheers
@cancheers 10 ай бұрын
should it be merged_model = trained_model.merge_and_unload()? cannot run, it is killed
@rone3243
@rone3243 10 ай бұрын
I have this problem as well😢
@kpratik41
@kpratik41 10 ай бұрын
Were you able to solve this?
@fl028
@fl028 4 ай бұрын
merged_model = trained_model.merge_and_unload()
@MecchaKakkoi
@MecchaKakkoi 5 ай бұрын
This looks like a great notebook, however, I always get a "CUDA out of memory" error when it executes the SFTTrainer function. It's fine up until then according to nvidia-smi but then memory just instantly maxes out. Does anyone know a way around this?
@rishabjain9275
@rishabjain9275 5 ай бұрын
try reducing the sequence length
@fl028
@fl028 4 ай бұрын
I reduced per_device_train_batch_size=1,
@okopyl
@okopyl 9 ай бұрын
Why do you use that kind of prompt for the training like `### Instruction`? When in fact Llama 2 prompts are like `[INST] `...
@g1rlss1mp
@g1rlss1mp 9 ай бұрын
I think it's a LLaMA2-CHAT prompt. The base model was not finetuned.
@skahler
@skahler 9 ай бұрын
omg @ 15:06 😂😂😂
@JeeneyAI
@JeeneyAI 5 ай бұрын
ALL of these tutorials require more dependencies. Can't somebody post how to do this in pycharm with your own GPU? I can't make any of the tutorials I've found work and it's just an endless troubleshooting process as to why everything is different in all of them
QLoRA-How to Fine-tune an LLM on a Single GPU (w/ Python Code)
36:58
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 53 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 192 МЛН
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 61 МЛН
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,3 МЛН
Why Fine Tuning is Dead w/Emmanuel Ameisen
50:07
Hamel Husain
Рет қаралды 17 М.
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 279 М.
I Analyzed My Finance With Local LLMs
17:51
Thu Vu data analytics
Рет қаралды 450 М.
Prompt Engineering, RAG, and Fine-tuning: Benefits and When to Use
15:21
"okay, but I want Llama 3 for my specific use case" - Here's how
24:20
GraphRAG: LLM-Derived Knowledge Graphs for RAG
15:40
Alex Chao
Рет қаралды 96 М.
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 53 МЛН