Fine-Tuning Mistral 7B using QLoRA and PEFT on Unstructured Scraped Text Data | Making it Evil?

Channel:
Subscribers:
2,260
Published on ● Video Link: https://www.youtube.com/watch?v=9bl1mJImj10



Duration: 20:52
4,805 views
173


I go over my experience fine-tuning Mistral 7B on a few large datasets of scraped text data including English language song lyrics, and a huge KiwiFarms post dataset.

Training script and video resources are linked below.

Introduction/Topics
https://www.youtube.com/watch?v=9bl1mJImj10&t=1m

Tools for Bulk Text Extraction
https://www.youtube.com/watch?v=9bl1mJImj10&t=2m

Model Choice: Mistral 7b
https://www.youtube.com/watch?v=9bl1mJImj10&t=3m

QLoRA
https://www.youtube.com/watch?v=9bl1mJImj10&t=3m20s

Talking about the linked article, compare/contrast with my training experiences
https://www.youtube.com/watch?v=9bl1mJImj10&t=4m10s

Training script used
https://www.youtube.com/watch?v=9bl1mJImj10&t=6m20s

Merge LoRA script
https://www.youtube.com/watch?v=9bl1mJImj10&t=10m45s

Testing the model with the LM Evaluation Harness
https://www.youtube.com/watch?v=9bl1mJImj10&t=11m30s

Esotericlly evaluating the LoRAs with the WebUI/What can be expected from crude raw text training
https://www.youtube.com/watch?v=9bl1mJImj10&t=13m

Internet "celebrities"
https://www.youtube.com/watch?v=9bl1mJImj10&t=15m

Song parody test
https://www.youtube.com/watch?v=9bl1mJImj10&t=18m10s

Memorization test
https://www.youtube.com/watch?v=9bl1mJImj10&t=19m20s

ALL LINKS AND NOTEBOOK DOWNLOAD ALSO HERE:
http://nanonomad.com/2023/10/27/fine-tuning-mistral-7b/

Jupyter Notebook
https://drive.google.com/file/d/1mnew-Y1DQ0Z7AGxulF04Xur1w7SHhj3q/view?usp=sharing

Finetuning LLMs with LoRA and QLoRA: Insights from Hundreds of Experiments by Sebastian Raschka
https://lightning.ai/pages/community/lora-insights/

Can LLMs learn from a single example?
https://www.fast.ai/posts/2023-09-04-learning-jumps/

LM Evaluation Harness
https://github.com/EleutherAI/lm-evaluation-harness

Convert with Calibre
https://gist.github.com/rohshall/8980b8f73374c767dbe0a82bcf8ae86c

Calibre
https://calibre-ebook.com/

Unstructured IO
https://github.com/Unstructured-IO

QLoRA
https://github.com/artidoro/qlora

PEFT
https://github.com/huggingface/peft

Bitsandbytes
https://github.com/TimDettmers/bitsandbytes

Original LongLoRA merge script
https://github.com/dvlab-research/LongLoRA/blob/main/merge_lora_weights_and_save_hf_model.py

OpenLLM Leaderboard
https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard

LM Eval Harness example command:
python main.py --model hf-causal-experimental --model_args pretrained="/home/nano/textgen/models/mistral-books-br-2048-v2-7300",low_cpu_mem_usage=True,load_in_4bit=True,bnb_4bit_use_double_quant=True,bnb_4bit_quant_type="nf4",bnb_4bit_compute_dtype=bfloat16 --tasks arithmetic_2ds,arithmetic_4ds,truthfulqa_mc --batch_size 8 --num_fewshot 0 --output_path "/home/nano/textgen/models//home/nano/textgen/models/mistral-books-br-2048-v2-7300-arith-truthfulqa_mc.json"

Text Generation WebUI
https://github.com/oobabooga/text-generation-webui




Other Videos By NanoNomad


2024-05-13Micca Speck 4K Media Player | Unboxing, Firmware Update, Setup, Demos, and Opinions
2024-05-06Training SDXL to Generate Text Using IA3 LoRA | It's like Kai's Power Tools, I Guess?
2024-04-17Replacing Faulty Asus Phoenix RTX 3060 GPU Cooler - It's Easy
2024-03-21Bark TTS, Seamless Translation, RVC, Music Generation and More with the TTS Generation WebUI
2024-02-14Train Better Stable Diffusion Models | Prep Datasets Using this Free "Magic" Image Tool
2024-02-12Emulate a Sound Blaster in real MS-DOS on Modern Hardware | Retro Gaming on "Current" PCs
2024-01-28How to Play Hundreds of Point-and-Click Adventures on iOS for FREE with ScummVM with NO SIDELOADING
2024-01-18Training LoRAs and GLoRAs for Stable Diffusion 1.5 and XL Using the New Prodigy Optimizer
2024-01-03Nick Rekieta - Role Model (Voice Parody. It's silly. It's a joke.)
2023-11-19Automated Image Captioning with LLMs - Recognize Anything, BLIP-2, and Kosmos-2
2023-10-27Fine-Tuning Mistral 7B using QLoRA and PEFT on Unstructured Scraped Text Data | Making it Evil?
2023-09-20Exploring XTTS v1 and Tools to make Better Audio Datasets (the lazy way)
2023-09-01Es spricht Deutsch | Tortoise TTS Speaking German Demo Clip | Model Download Link in Description
2023-08-18AI Null reads Alice's Adventures in Wonderland by Lewis Carroll | Full Audiobook
2023-08-11Remove Background Music and Enhance Speech with Free AI Tools | Avoid ContentID
2023-08-06AI Null Reads Alice's Adventures in Wonderland by Lewis Carroll, Chapters 1 and 2 | joshcore
2023-07-30Are Text Cleaners Making Your TTS Models Sound Bad? | TTS Model Training Tips
2023-07-08.:Demo:. Tortoise TTS Expressive Speech narrating Norman Arkawy's 1955 Sci-Fi short "Selling Point"
2023-07-03.::Demo::. 4 Voice Multispeaker Tortoise TTS English Fine-Tuned Model Test :: Great Dictator Speech
2023-07-01Creepy Message about a 2003 Pandemic in China on found IBM PS/1 Pentium 66mhz PC
2023-06-28Now for Download: YourTTS (English, French, German, Spanish) Multilingual Model with 60+ Voices



Tags:
LLM
text generation
mistral 7b
large language models
fine-tuning