Can't upload a file to finetune. Can't upload raw json. ChatGPT sends me in a circle of useless python scripts. Plz help

Haven’t coded in a decade, and even then was a self-taught javascript amateur, currently being sent in a circle by ChatGPT - Plz help.

Tried to follow this to upload a file:
In order to finetune:

Even tried to upload the raw json and absolutely nothing works.

Hi and welcome to the Community!

What specific error(s) are you getting?

so many! lol

This is the latest:

Error uploading data:
  "error": {
    "message": "Invalid Content-Type header (application/json), expected multipart/form-data. (HINT: If you're using curl, you can pass -H 'Content-Type: multipart/form-data')",
    "type": "invalid_request_error",
    "param": null,
    "code": null

If it’s urgent and you struggle with the technical side of it, you can also consider using the finetuning UI for uploading your files and initiating the fine-tuning process.

It is urgent. I have tried that but it only takes a jsonl file… I already had to figure out how to convert the csv to json, but that finetune uploader only takes jsonl (assuming that’s jsonL) how do I convert to that? The internet has not been helpful.

A simple way would be to just download a free code editor if you not already have one installed (e.g. Visual Studio Code), paste your JSON in there and then save it as a JSONL file.

Important is that you need to make sure that every training example is in a single line as per for the example in the guidance.

ok I downloaded Visual Studio Code a couple hours ago. So I legit just paste in the json text and then save it as .jsonl and it will work?
I realize this is extremely remedial and I am VERY grateful for your help / kindness.

ok that didn’t work it gave me an error that said
“There was an error uploading the file: Expected file to have JSONL format, where every line is a valid JSON dictionary. Line 1 is not a dictionary (HINT: line starts with: “[…”).”

There should be no problem.

This is what it should look like if the formatting is correct (using the example data from the finetuning guidance).

1 Like

You need stick to the exact formatting - look at the example provided. You can’t deviate from that otherwise it will keep throwing an error.

1 Like

ah, ok so i have a lot of weird [ square brackets] to take out… why are they there… hmm I feel like the online json thing I used, didn’t quite make it json… it ALMOST looks like that but I can’t remove all the [ square brackets] manually for 900 rows

so it looks like i have to do this manually then… do you have a good csv to json converter online that you use?

Is the data correctly formatted in your csv file? You can also copy and paste directly from the csv file to the JSONL file.

Otherwise, just use ChatGPT to write you a short script to convert your raw data in the csv file into the proper format based on the prescribed standards.

looks like i’ll have to manually reformat all 900 rows…nothing else is working