Skip to content

Fine Tuning

cybercoder edited this page Jan 7, 2024 · 1 revision

Intellinode offers a unified layer for models fine-tuning. The current version supports OpenAI, with additional models to be included in future versions.

Openai Tuning

  1. Import the required modules:
const { RemoteFineTuneModel, SupportedFineTuneModels, FineTuneInput } = require('intellinode');
  1. Create a FormData object with your training data and purpose:
const filePath = 'training_data.jsonl'
const filePayload = new FormData();
filePayload.append('file', createReadStream(filePath));
filePayload.append('purpose', 'fine-tune');
  1. Create an instance of the RemoteFineTuneModel class:
const tuner = new RemoteFineTuneModel(openaiKey, SupportedFineTuneModels.OPENAI);
  1. Fine-tune your model by uploading your training data, preparing the tuning input, and initiating the tuning process.
// // Upload your training file
const file = await tuner.uploadFile(filePayload)
// Prepare the tuning input
const input = new FineTuneInput({
      model: 'gpt-3.5-turbo',
      training_file: file.id
})
// start the training activity
const result = await tuner.generateFineTune(input)
// list available fine-tunes
const list = await tuner.listFineTune()
Clone this wiki locally