Giter VIP home page Giter VIP logo

replicate-llm-training's Introduction

Fine tune an LLM using Replicate

How-to guide on Youtube

train.js is a script for kicking off a fine-tuning of a large language model using the Replicate API.

You can fine-tune your language model with your own training data and choose from one of the available models: Llama, GPT, and Flan.

You need:

  • An account on Replicate
  • Your Replicate API token
  • A destination model to save your fine tuned model (Create a model)
  • Training data in a .jsonl file, in the format: { prompt: "...", completion: "..." }
  • A URL pointing to your generated training data

Installation

git clone https://github.com/fofr/replicate-llm-training
cd replicate-llm-training
npm install

Set up

Rename .env.example as .env and add your Replicate API token.

Open train.js and:

  1. Set the destination variable to the username and model name you want to save the fine-tuned model to. For example, if your username is myusername and you want to save the model as mymodel, set destination to 'myusername/mymodel'.

  2. Set the training_data_url variable to the URL of your training data.

  3. Choose the pre-trained model you want to fine-tune. Use one of the following:

const [llm, version] = LLMs.llama // For Llama model
const [llm, version] = LLMs.gpt   // For GPT model
const [llm, version] = LLMs.flan  // For Flan model

Start training

After setting the variables, save the file and run the script with node train.js. The script will create a new fine-tuning job using the Replicate API, and it will print the details of the training job, including the URL to track the progress of your fine-tuning.

Track or cancel training

From the replicate.com dashboard you can:

  • see the progress of your training
  • view the logs
  • cancel the training

replicate-llm-training's People

Contributors

fofr 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.