I get Error 400 (Bad request) on creating fine-tuned model

Hi, I am trying to create a new fine-tuning model but when I send the request to create it, I get an error 400 (bad request) back… I don’t know what I am doing wrong.
I know authorization works, as I have tried some other endpoint and it worked…
This is the endpoint I am using: https://api.openai.com/v1/fine_tuning/jobs
Ok, so this is my json that I am sending:

{"training_file":"file-{some characters}","model":"gpt-3.5-turbo"}

I also tried with sending the file name instead of file id but that didn’t work either…
This is my code for reference:

var requestModel = new CreateFineTuneRequestModel
    TrainingFile = trainingFileId,
    Model = model

var requestJson = JsonConvert.SerializeObject(requestModel);

var endpoint = $"/v1/fine_tuning/jobs";

var response = await _httpClient.PostAsJsonAsync(endpoint, requestJson);

Hi and welcome to the developer forum!

Have you been through the steps here to check everything is functioning?

Ok, so basically I just found out that if I have an older file, it works??? The way I make the training file is the same for all of them… Is there a timespan between when I can create a file and when I can use it? Because when I upload the file it is always successful…

If you are not able to use a new file, it usually indicates there is a problem with the json structure of that new file, have a look through it and see if you can spot any issues.

Problem is I don’t have access to the file on the dashboard on OpenAI…
Is there any other way I could look through and spot any mistakes?

You upload the file to OpenAI, so it’s whatever you uploaded.

I looked through the JsonL, but they both have the same structure and everything, so I don’t think the content could be the problem.

I found out the issue… You have to have 10 elements in the file to work… I always had 9 in testing…

1 Like