Giter Club home page Giter Club logo

llm_gptq__finetuning's Introduction


Logo

Finetuning our quantized model for specific task

This repository contains a convenient wrapper for fine-tuning GPTQ models and will be used to fine tune our quantized model.

This repo is built upon these materials:

Key Features

  • Fine tuning GPTQ model and retrieving a LORA
  • we will use the LORA retrieved from this fine tuning to create a mutli task head for our LLM
  • Memory-efficient fine-tuning to make our lora smaller and faster.

Usage

First you will need a GPU instance

Setup

  1. Clone the repository

    git clone https://github.com/Leulassaminew/llm_GPTQ__finetuning.git
  2. Change to the directory

    cd llm_GPTQ__finetuning
  3. Install default dependencies

    pip install -r requirements.txt
  4. Install quant dependencies

    pip install -r cuda_quant_requirements.txt
  5. Disable Wandb

    wandb disabled
  6. make a directory to store the model

    mkdir models
  7. download the GPTQ model

    python download_private.py
  8. Now we will start fine tuning by selecting specific data set from the hub

    python finetune.py \
     --base_model models/meetplacesales \
     --data_path 'meetplace1/classification' \
     --output_dir 'output_lora' \
     --batch_size 128 \
     --micro_batch_size 4 \
     --train_on_inputs True \
     --num_epochs 10 \
     --learning_rate 2e-4 \
     --cutoff_len 1600 \
     --group_by_length \
     --val_set_size 0.05 \
     --eval_steps 0 \
     --logging_steps 5 \
     --save_steps 5 \
     --gradient_checkpointing 1 \
     --mode gptq \

You can change the dataset used by simply changing the data_path parameter Note that the installation of above packages requires the installation of CUDA to compile custom kernels. If you have issue, looks for help in the original repos GPTQ, exllama for advices.

Data Preparation

We have Prepared the instruction data to fine-tune the model in the following JSON format.

[
{
    "description": "Template used by Alpaca-LoRA.",
    "prompt_input": "Below is an instruction that describes a task, Write a response that appropriately completes the request.\n\n### Instruction:\n Categorize the input text based on the sales technique used in it from one of these categories only and offer no explanation:\n\nBUILDING RAPPORT\nNEEDS ASSESMENT\nCREATING URGENCY\nSOCIAL PROOF\nOVERCOMING OBJECTION\nCROSS SELLING OR UPSELLING\nVALUE BASED SELLING\nSPIN SELLING\nNEURAL SELLING\nNONE.\n\n### Input:\n{input}\n\n### Response:\n",
    "response_split": "### Response:"
}
]

You can supply a single JSON file if you want to change the instruction format.

llm_gptq__finetuning's People

Contributors

taprosoft avatar leulassaminew avatar

Stargazers

 avatar

Forkers

collij22

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.