Fine-Tune Your Own Tiny-Llama on Custom Dataset

preview_player
Показать описание
What to learn how to customize tiny llama on your own dataset? Here is how to do it.

LINKS:

TIMESTAMPS:
[00:00] Introduction
[01:07] Training dataset
[02:29] Setting Up the Code
[04:19] Formatting the Dataset
[06:49] Setting Up the Model and LoRAs
[09:58] Training the Model
[10:37] Merging the Model and LoRa Adapters
[11:31] Inference and Testing
[14:02] Conclusion and Future Prospects

All Interesting Videos:

Рекомендации по теме
Комментарии
Автор

The system prompt in the notebook seems to be incorrect, TinyLlama's model card says the prompt is:


I ran the notebook with it and finetuned model works surprisingly good.👍

azarovalex
Автор

Thank you so much for this video. Creating dataset from gpt to fine tune other open source model was smart move. It helped to create my custom dataset for mistral 7b

neelbanodiya
Автор

Amazingly good example of text classification by an LLM! It also is a great tutorial on fine tuning using PEFT with LoRA. I really like this because one can directly verify the inference (i.e. color) with one’s own eyes.

vijaynadkarni
Автор

A really helpful video. Thank you!
I had one question though, when fine-tuning you loaded the model in a quantized manner, whereas while inference you loaded the original model. Any specific reason behind the same? Wouldn't fine-tuning with the non quantized model be considered better?

aviralagarwal
Автор

Now looking for the Mistral people to release a Mixtral 8x1b model that will run on small-ish devices (my 16gb MacBook Pro, for instance).

jdray
Автор

I have the problem that my model often "forgets" the last number of the hexadecimal code. Depending on the input, I sometimes get a correct hexadecimal code and sometimes total nonsense because the last number is missing. Do you happen to know the reason for this (I'm completely new to ML)? I have trained the model for three epochs and otherwise left all parameters the same, as you do in your video. Apart from that, I only changed the prompt style so that it works properly. Which parameters would you advise me to play with first to get better results? Should I adjust the learning rate or perhaps train more epochs?

SaVoAMP
Автор

I want to fine tune on a context based question and answers dataset, what prompt template can I follow? With specific prompt templates how does the model focus on only the answer for calculating the loss?

VikasUnnikkannan-wklu
Автор

So, how would I use this model offline? In LM Studio for example.

metanulski
Автор

Let's see some local fine-tuning. Maybe with Ollama on a Mac.

Joe_Brig
Автор

Thanks for the video. One question: the program sets epoch as 3 and step as 250, why the log stop at epoch = 0.47?!

franky
Автор

I ran the collab notebook (run all, without changes) but i got different results. It seems that the fine tuning did not work and the results are generic.

turkololi
Автор

i have a doubt with the dataset path, is it just /colors or colors.jsonl that you have created?

harikrishnank
Автор

Thank you for this video. Since you have used only input and response in text formatter, I want to add instruction as well. Among these two which one will work for my case or correct if any changes required in below text formatrer

1.

2. f"<|system|> {instruction} </s> <|user|> {input}</s> <|assistant|> {response}</s>"

adityashinde
Автор

How do you use it? After training it, you download it and load the model into ollama for example?

RuarkvallenTapel
Автор

Hi..suppose I need to fine tune llms to create a structured summary (domain specific) while uploading the pdf file. For creating the datasets for the same, I have used chat gpt. But as there is a limit in the token size of llm, I am not able to create dataset using long documents. Can we create such a dataset using RAG? If we are creating datasets for training, then we must include the entire document and its structured summary, which will be very very lengthy. Is there any option to fine tune llm for such large documents using rag or any other technology?

vishnuprabhaviswanathan
Автор

many many thanks mister, very quick and helpful

Hash_Boy
Автор

Brilliant! Thank you!

If you (or someone) can help me refine my understanding of LoRAs: do you need to merge a LoRA with either a base or a fine-tuned model in order to get use out of it, or can the LoRA be useful independently?

jdray
Автор

hello How can I run this model locally but train it from the colab?

xalchemistxx
Автор

Thank you so much!!! It's a really nice tutorial. ☺

soyedafaria
Автор

Amazing! Can you try it on a little Documentary base (20 small PdF of 15/20 pages)?

xflrx