Gasby provides the OAI Finetune tool to help fine-tune your models (using OpenAI new's API). For more details, visit OpenAI Fine-tuning
At the moment, we only support fine-tuning OpenAI models. OpenAI supports fine-tuning gpt-3.5-turbo
(recommended), babbage-002
, and davinci-002
models
To fine-tune a model, you'll need:
Once completed, a new model will be created. You'll be able to config and use this model in the Provider settings
OpenAI accepts JSONL format for fine-tuning a model. JSONL is a multi-line data in JSON format. Note that not all models have the same data input.
For gpt-3.5-turbo
model, the JSONL file will have the following format
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?"}]}
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters."}]}
For other models, the JSONL file will have the following format
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
Note that to finetune a large content, such as an article, a document, or a book, you should split the content into multiple chunks. Check out this discussion to learn more about fine-tuning books
Once you have prepared the fine-tuned data, save it into a jsonl file.
Upload file
and select your JSONL file prepared earlier. It'll start uploading the fileRefresh
if you don't see itMake sure you have the correct file data format, and the filename should appear in the files table.
Finetune
. It'll open up the Start fine-tuning popup.Finetune file
, and your fine-tune Model
are correctStart
to start the fine-tuning processNow, you'll be able to see the process in the Finetune jobs
tab
Depending on how big your finetune data is, it might take a few minutes to hours to complete the finetune process. I've tried to fine-tune with a 12-line data file, it took around 20 minutes to complete the process.
In the OAI Finetune tool > Finetune job, you should be able to see the status of the process. Once the fine-tuning process is completed, you can use the fine-tuned model to chat.
To use the model for chatting:
Use this model
(message icon). It'll update your provider settings to OpenAI, and set the model name to the new fine-tuned model