CLI 3: Tuning The Model

Tom Chant
InstructorTom Chant
Share this video with your friends

Social Share Links

Send Tweet
Published a year ago
Updated a year ago

You'll be given step-by-step instructions on fine-tuning a model for data preparation using the OpenAI CLI tool. We learn how to utilize the fine-tunes.create command and specify the training data file. Additionally, we explore the option of using different base models, with the DaVinci model being the preferred choice.

The fine-tuning process may take a varying amount of time, with intermittent live updates from OpenAI. We are reassured that the process continues even if the live updates cease. Eventually, upon successful completion, we receive our own fine-tuned model. Before integrating this model into our app, we are informed that changes need to be made in our JavaScript code. This step prepares us for utilizing the newly fine-tuned model effectively.

[00:00] Okay, let's get to work on the fine-tune. At the end of the data preparation process, we got this instruction. So, let's just break down what that is telling us to do. Firstly, we're using the OpenAI CLI tool to access the API.

[00:16] Then, we need to use this fine-tunes.create command, and we use the T flag here to introduce our training data, and we save that in a file called we-wingit-data underscore prepared dot jsonl.

[00:32] Our training data, which has been prepared into the jsonl format. Now, we need to add just a little bit more to the end. The docs tell us that we can use an M flag to specify the base model to use, and we're going to use the DaVinci model.

[00:47] If we leave that blank, it will actually default to the older Curie model. Okay, let's put that command in the terminal, and when I press enter, we get this message. Now, OpenAI needs to enqueue this, and it takes some time. The quickest for me has been a few minutes. The longest was literally all night.

[01:06] Now, down here, it says stream interrupted, client disconnected. That is really common. It doesn't mean that the fine-tune process has stopped. It just means that OpenAI is no longer giving us live updates, and what we can do is take this command here, paste it, and run it, and that will reconnect us to the information stream,

[01:25] and eventually we'll get this message with an emoji that tells us we have been successful. And then what we see down here is actually our very own fine-tuned model. It's everything from DaVinci right up until the date. Now, that's pretty cool, but before we can use that model in our app,

[01:43] we need to make some changes to our JavaScript. So let's go ahead and do that next.

egghead
egghead
~ 27 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today