-
Notifications
You must be signed in to change notification settings - Fork 16
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.
- Import the required modules:
const { RemoteFineTuneModel, SupportedFineTuneModels, FineTuneInput } = require('intellinode');
- 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');
- Create an instance of the RemoteFineTuneModel class:
const tuner = new RemoteFineTuneModel(openaiKey, SupportedFineTuneModels.OPENAI);
- 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()