Skip to content

OpenAI.FineTuneData

Andrew Lambert edited this page Jul 14, 2024 · 5 revisions

OpenAI.FineTuneData

Class Declaration

 Protected Class FineTuneData

Remarks

This class can create, load, and save JSONL-based training files for the fine-tuning API. Once you have created the training file locally you can upload it using the File.Create shared method.

Example

This example creates a new training file and uploads it for use with fine-tuning:

  OpenAI.APIKey = "YOUR API KEY"
  Dim file As FolderItem = SpecialFolder.Desktop.Child("example.jsonl")
  Dim trainingdata As OpenAI.FineTuneData = OpenAI.FineTuneData.Create(file)
  trainingdata.AddLine("You are a helpful assistant.", "What is the capital of France?", "Paris is the capital of France.")
  trainingdata.AddLine("You are a helpful assistant.", "What is the capital of Germany?", "Berlin is the capital of Germany.")
  trainingdata.AddLine("You are a helpful assistant.", "What is the capital of Spain?", "Madrid is the capital of Spain.")
  ' etc. 
  trainingdata.Save(file, True)
  Dim trainingfile As OpenAI.File = OpenAI.File.Create(file, "fine-tune")

Methods

Properties

Shared methods

Clone this wiki locally