Giter VIP home page Giter VIP logo

praveen76 / fine-tune-llama-with-qlora Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 10.5 MB

This repository showcases the implementation of the QLoRA Method to fine-tune the Llama language model, enabling efficient deployment of lightweight models for various downstream tasks in natural language processing. Explore advanced techniques for enhancing LLMs in practical applications.

Home Page: https://towardsmachinelearning.org/

License: MIT License

Jupyter Notebook 100.00%
finetune-llm large-language-models llama qlora

fine-tune-llama-with-qlora's Introduction

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.

fine-tune-llama-with-qlora's People

Contributors

praveen76 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.