Skip to content

whattocode/finetunedchatgpt3-demo

Repository files navigation

The following Steps to fine-tuning:

Step 1: Setup Environment:

Install openai package on your machine:

pip install --upgrade openai

API key: export it as an environment variable:

export OPENAI_API_KEY="your-api-key"

Step 2: Prepare json data:

Prompt an Completion Formating: input file is basketball_data.csv, output file is going to be prompt_completion_pairs.json

python prompt-completion-formating-to-json.py

Step 3: Prepare training jsonl data:

converting prompt_completion_pairs.json to jsonl, the jsonl is going to be training-file

openai tools fine_tunes.prepare_data -f <LOCAL_FILE>

Sample:

openai tools fine_tunes.prepare_data -f prompt_completion_pairs.json

Step 3: Fine-Tune:

create custom model by using the prompt_completion_pairs_prepared.jsonl file

openai api fine_tunes.create -t <TRAIN_FILE_ID_OR_PATH> -m <BASE_MODEL>

Sample:

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages