Coder Social home page Coder Social logo

llm-trainer's Introduction

Train LLMs with qLoRA!

Introduction

This repository contains scripts and configurations for training and merging models using the qLoRA method for efficient model training.

Prerequisites

  • Python 3.x
  • PyTorch
  • Transformers
  • BitsAndBytes
  • pandas
  • YAML

Install the required libraries using:

pip install -r requirements.txt

Configuration File (lora_config.yaml)

This YAML file contains configuration settings for the training process. Update the auth_token with your token and adjust other parameters as per your requirement.

Training the Model (lora_train.py)

The lora_train.py script trains the model based on the configuration provided in lora_config.yaml. Please make sure the data you have is in the appropriate format and mention the column name that has the data in the config file.

To start the training process, make sure all the values in the lora_config.yaml file are correct and then run the training script:

python lora_train.py

The script will save the trained model in the specified output directory.

Merging LoRA Layers (merge_lora.py)

The merge_lora.py script merges LoRA layers into a base model.

Before running the script, fill in the model_name_or_path, auth_token, out_folder_path, and lora_checkpoint_path in the script.

Troubleshooting

If you encounter any issues, please check if your environment meets all prerequisites. For further assistance, create an issue in this repository.

llm-trainer's People

Contributors

04rr 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.