This repo contains code to fine-tune Large Language Models(LLMs) with a famous quotes dataset.
The supported methods of Finetuning are DeepSpeed, Lora, or QLora.
Originally, the repo downloaded and converted the model weights for GPTJ when it was not yet added to Huggingface transformer package. That code can still be seen under the branch original_youtube
.
/quotes_dataset
contains the dataset properly formatted for fine-tuning. See repo for making this dataset here
/finetuning_repo
contains code originally from the repo here that I have modified to work with more models and with more methods.
If are in need of paid professional help, that is available through this email
See the old video for the original repo code here for a video tutorial.
A more updated video for using the Huggingface model can be seen here
Go to the original_youtube
branch is you want to see the code, but I HIGHLY recommend you use more modern methods
The updated walkthrough uses Nvidia-docker to take the headache out of much of the process.
If you have a 64-bit Linux system and need drivers for an A100, you can run a command like this to get set up.
wget https://us.download.nvidia.com/tesla/515.86.01/NVIDIA-Linux-x86_64-515.86.01.run
You will then run the downloaded program with sudo.
chmod 777 NVIDIA-Linux-x86_64-515.86.01.run
sudo ./NVIDIA-Linux-x86_64-515.86.01.run
build_image.sh
. If you receive an error about not being able to find the docker image, update to a newer Cuda version. The images are periodically deprecated. Then open a PR so you can fix this issue for others. Building the docker image can take many minutes.run_image.sh
. This script runs the docker image that was just built and mounts the current directory to /workspace
inside of the docker container. All GPUs in the system will be passed through. Additionally, to prevent downloading models each time this container is run, your .cache
will also be passed through.