This repository provides a streamlined and efficient pipeline for fine-tuning LLaMA-based language models using the Unsloth library. It is designed for instruction-tuning tasks with support for QLoRA, PEFT, and Hugging Face datasets.
The finetuning_project_unsloth.py script enables fine-tuning of pre-trained LLaMA models with a focus on low memory usage and high performance. It incorporates the latest advancements in parameter-efficient fine-tuning and is well-suited for custom dataset applications such as chatbot instruction tuning or domain-specific model adaptation.
- Fine-tuning using QLoRA for memory-efficient training
- Integration with the Unsloth framework and Hugging Face ecosystem
- Support for instruction-format datasets with
inputandoutputfields - Flexible configuration for training parameters, model type, and dataset path
- Compatible with both local GPU setups and cloud environments
To install the required dependencies:
pip install unsloth datasets trl peft accelerateEnsure that your system meets the hardware requirements for running LLaMA-based models, preferably with a GPU (16GB+ VRAM recommended).
The script expects datasets in JSON or Hugging Face-compatible format with the following structure:
{
"input": "Your prompt here",
"output": "Expected model response"
}Update the model and dataset paths as required in the script, then execute:
python finetuning_project_unsloth.pyThis will initiate the fine-tuning process and save the model checkpoint and LoRA adapters upon completion.
- Fine-tuned model artifacts are saved to the
./modeldirectory - LoRA adapter weights are stored for efficient deployment or merging