Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 2.27 KB

README.md

File metadata and controls

64 lines (41 loc) · 2.27 KB

Fine-tune-LLAMA-with-QLoRA

Overview

This repository provides an implementation of the fine-tuning process for Large Language Models (LLMs), specifically LLAMA, using the QLoRA (Quantized Low Rank Adaption) method. ]

QLoRA stands for Quantized Low Rank Adaption. It is a new approach to fine-tuning large language models (LLMs) that uses less memory while maintaining speed. QLoRA works by first quantizing the LLM to 4-bits, reducing the model’s memory footprint significantly. The quantized LLM is then fine-tuned using the Low Rank Adapters (LoRA) approach. QLoRA is a versatile technique applicable to different language models, including RoBERTa, DeBERTa, GPT-2, and GPT-3, enabling researchers to explore parameter-efficient fine-tuning for various LLM architectures. QLoRA was developed by members of the University of Washington's UW NLP group.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.x
  • torch
  • transformers
  • datasets
  • peft
  • accelerate
  • bitsandbytes
  • trl
  • safetensors
  • ipywidgets
  • huggingface_hub

Getting Started

  1. Clone this Repository:

    git clone https://github.com/Praveen76/Fine-tune-LLAMA-with-QLoRA.git
    cd Fine-tune-LLAMA-with-QLoRA
    
  2. Install Dependencies:

    pip install -r requirements.txt
    
  3. Fine-Tune Llama2:

    • Use the provided Jupyter notebook (Fine-tune-LLAMA-with-QLoRA.ipynb) to fine-tune Llama2 on your custom dataset.
    • Adjust hyperparameters, training settings, and evaluation metrics as needed.
  4. Evaluate and Deploy:

    • Evaluate the fine-tuned model's performance on validation data.
    • Deploy the model for inference in your applications.

Contributing

If you'd like to contribute to this project, please follow the guidelines in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Contact

For questions or inquiries, feel free to contact me on Linkedin.

About Me:

I’m a seasoned Data Scientist and founder of TowardsMachineLearning.Org. I've worked on various Machine Learning, NLP, and cutting-edge deep learning frameworks to solve numerous business problems.