Code Monkey home page Code Monkey logo

train-gpt3-openai-whatsapp-chat's Introduction

OpenAI GPT-3 Chat using OpenAI API

Train OpenAI completion model using Whatsapp chat export to speak like your friend.

Setup

Install requirements in venv

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Export creds environment variable export OPENAI_API_KEY=<insert api key from openai here>

Prepare data

Use notebook create_data_from_whatsapp_export.ipynb to parse Whatsapp chat export and save csvs with message, reply pairs.

Then use the openai command line tool to convert the CSVs to JSONL files used to train custom GPT-3 models.

openai tools fine_tunes.prepare_data -f data_alex.csv

openai tools fine_tunes.prepare_data -f data_yashodan.csv

Train models

openai api fine_tunes.create -t data_alex_prepared.jsonl -m curie

openai api fine_tunes.create -t data_yashodan_prepared.jsonl -m curie

Trained models:

  • alex curie:ft-user-3r7wl<...>e-2021-08-21-13-09-19
  • yashodan curie:ft-user-3r7w<...>e-2021-08-21-13-20-04

Use trained model

remember to include prompt ->

Alex

curl https://api.openai.com/v1/completions \
  -H "Authorization: Bearer sk-Ge<...>QC" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Do you want to test it out? ->", "model": "curie:ft-user-3r7wl<...>e-2021-08-21-13-09-19"}'

Yashodan

curl https://api.openai.com/v1/completions \
  -H "Authorization: Bearer sk-Ge<...>QC" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Do you want to test it out? ->", "model": "curie:ft-user-3r7w<...>e-2021-08-21-13-20-04"}'

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.