openai.error.InvalidRequestError: Expected file to have JSONL format, where every line is a JSON dictionary. Line 1 is not a dictionary

I’ve created a dataset using openai tools, an looking to finetune my model with it. Unfortunately I get the error in title:
openai.error.InvalidRequestError: Expected file to have JSONL format, where every line is a JSON dictionary. Line 1 is not a dictionary

I’ve reduced my jsonl file to the following simple one, though the error keeps occurring:
{“prompt”:“aa”, “completion”: “bb”}
{“prompt”:“cc”, “completion”: “dd”}

What am I missing in the jsonl file format?

Solved.
I called with

file="mydata.jsonl" 

instead of:

file=open("mydata.jsonl"),
5 Likes

I had the same error and this is my code

const response = await openai.createFile(
fs.createReadStream(“mydata.jsonl”),
“fine-tune”
);
how can solve my issue