This repo will contain various examples of fine tuning large language models.
*** mamba activate ftllm ***
Creating and Uploading a Dataset with Unsloth: An Adventure in Wonderland
Working through the document from below ...
- mamba install conda-forge::sentence-transformers
Training and Finetuning Embedding Models with Sentence Transformers v3
Another re-run of Alpaca_+_Llama_3_8b_full_example _(Prompt_Engineering).ipynb with higher settngs.
And gonna take a small segway into Triton since this stuff is in the unsloth_env2 environment. The code will go into the 'Triton' folder. Looking at this stuff, the impulse is to get back to CUDA ...
*** mamba activate unsloth_env2 ***
Attempting to run Triton/01-vector-add.py
Really!? No matplotlib in the unsloth_env2 environment?!! ...
- mamba install conda-forge::matplotlib
- mamba install conda-forge::pytest
- mamba install conda-forge::tabulate
Working through peft_finetuning.ipynb
- mamba install conda-forge::sentencepiece
- pip install llama-recipes (notice the mis-spelling of recipes)
Trying to understand why running peft_finetuning.ipynb the first time training took 35 minutes, then running it again with profileing enabled from the copied notebook peft_finetuning_2.ipynb it took about a minute and a half, then re-running peft_finetuning_2.ipynb again, but with a different target folder of tmp-profile it again took about a minute and a half ... is this because of something to do with wandb?? I really don't get it ...
Viewing the first 20 seconds of LLAMA-3 🦙: EASIET WAY To FINE-TUNE ON YOUR DATA shows me right away there are multiple open-source libraries available to facilitate fine tuning of local large language models. Sooo much energy is being directed at this task and it is rapidly shifting, so keep on this!
The Youtube channel Prompt Engineering is excellent! Gonna habituate looking at this channel!
*** mamba activate unsloth_env ***
Checking out unsloth. Create the new conda environment 'unsloth_env' for running the notebook 'Alpaca_+_Llama_3_8b_full_example.ipynb' linked from the page Finetune Llama 3 - 2x faster + 6x longer context + 68% less VRAM
Alpaca + Llama-3 8b full example.ipynb
Damn! My preliminary dive into unsloth is revealing some fantastic features of this package!
I was able to run 'Alpaca_+_Llama_3_8b_full_example.ipynb' in unsloth_dev with no problems!
Now will create a second conda environment almost identical to unsloth_env bit with a slightly different setup, supposedly catered to a 4090, and will name it unsloth_env2 ... I know ... really creative, right!?
- LLAMA-3 🦙: EASIET WAY To FINE-TUNE ON YOUR DATA 🙌
- https://colab.research.google.com/drive/1mPw6P52cERr93w3CMBiJjocdTnyPiKTX#scrollTo=2eSvM9zX_2d3
Hmm so ran this other notebook, and I really fail to see how this is any different from the first run ... meh.
Noteable links:
- Using and Finetuning Pretrained Transformers
- Finetuning Large Language Models
- Fine-tuning 20B LLMs with RLHF on a 24GB consumer GPU
- A Gentle Introduction to 8-bit Matrix Multiplication for transformers at scale using Hugging Face Transformers, Accelerate and bitsandbytes
Starting to run through the notebook 'Causal_models_like_Gemma_2B_finetuning_on_SamSum.ipynb', and looks like I have more stuff to install ...
- mamba install conda-forge::huggingface_hub
- mamba install conda-forge::ipywidgets
- pip install evaluate
- pip install rouge-score