forked from openai/openai-quickstart-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (18 loc) · 643 Bytes
/
index.js
File metadata and controls
22 lines (18 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import OpenAI from "openai";
import fs from "fs";
const openai = new OpenAI();
// Create a training file for the fine-tuning job
const trainingFile = await openai.files.create({
file: fs.createReadStream("fine_tuning/training_data.jsonl"),
purpose: "fine-tune",
});
console.log("Training file created");
console.log(trainingFile);
// Create a fine-tuning job
const fineTuningJob = await openai.fineTuning.jobs.create({
training_file: trainingFile.id,
model: "gpt-4o-mini-2024-07-18",
});
console.log("Fine tuning job created");
console.log(fineTuningJob);
console.log("Next step: Run use_model.js with Job ID ", fineTuningJob.id);