Closed Tohaker closed 2 years ago
Hi Tohaker, in the examples they are sending the file as a readable stream. Using createReadStream()
from the fs
module.
Did you tried this?
const fs = require("fs");
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createFile(
fs.createReadStream("puppy.jsonl"),
"answers"
);
Thanks, that worked. The description in the API differs from how this is implemented, I'll see if I can raise a PR
I'm trying to upload a file that can then be used to create a fine-tune. It's been passed through the CLI validator so I know it's correct, but I keep getting the following error from Axios:
Here's how I'm trying to upload the file;
Am I doing this right? I can't seem to see what the problem could be.