Code for fine-tuning Llama2 LLM with custom text dataset to produce film character styled responses
This code utilised QLoRA parameter efficient fine-tuning techniques to create a tailored Llama2 LLM capable of returning responses in the style of Gandalf from The Lord of the Rings
-
get_gandalf_data.py - webscrapes Gandalf text dialogue data from online resources
-
gandalf_dataset.py - creates query/response dataset from gandalf.csv which was generated from webscraped dialogue data
-
hyper_params.py - defines hyperparameters for training loop
-
train_gandalf.py - fine-tunes base Llama2 model with custom gandalf dataset using QLoRA peft techniques
-
evaluate.py - loads fine-tuned Llama2 model and produces Gandalf style response to input text prompt
Louis Chapo-Saunders