Giter Site home page Giter Site logo

reddit-gpt3-finetune's Introduction

Fine-Tuning a GPT-3 model from Reddit Data

This repository contains a Python script (main.py) which can take data from the reddit API and turn it into a JSONL file of prompt/completion pairs which can be used to fine-tune a GPT3 model. The prompts are post titles and the completions are the top comments.

This tool requires a bit of command line/terminal usage - if you have no experience with that, don't worry as you should be able to follow along just fine.

Requirements

Instructions

Getting the Reddit Data and creating the JSONL File

  1. Note down the client_id and client_secret from your reddit application
  2. In the main.py file, replace the values in lines 7, 8, and 9 with your reddit application credentials and the target subreddit
  3. Install praw. Usually this means navigating to the folder with the main.py file in the terminal and entering pip install praw or pip3 install praw
  4. Run the script. Usually this means entering python main.py or python3 main.py

This will produce a JSONL file of prompt/completion pairs in the folder with the main.py script.

Using the JSONL File to Fine-Tune a GPT3 Model

  1. In the terminal, enter openai tools fine_tunes.prepare_data -f reddit_data.jsonl
  2. Answer y to all of the prompts
  3. Take note of the suffix separator and suffix ending
  4. In the terminal, enter openai api fine_tunes.create -t reddit_data_prepared.jsonl

Congratulations! Your fine-tuning job will now be started by OpenAI!

It will take awhile (minutes or hours, generally) for the job to complete. If the stream is interrupted, don't worry as the job will continue. You can check the status of the job by entering openai api fine_tunes.follow -i <YOUR_FINE_TUNE_JOB_ID>.

Once completed, you can use the fine-tuned model via API or in the playground.

reddit-gpt3-finetune's People

Contributors

cshape-ztm 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.