0

I've been trying to upload a JSON file that I will use for fine-tuning my GPT-3 model. I get an error when trying to upload it.

openai.File.create(file=open("training_data.jsonl"), purpose="fine-tune")

When I run the command above, I get the following error:

InvalidRequestError: Resource not found

1 Answer 1

1

In general

The InvalidRequestError: Resource not found error in general means that you did something wrong in your API request. As stated in the official OpenAI documentation:

TYPE OVERVIEW
InvalidRequestError Cause: Your request was malformed or missing some required parameters, such as a token or an input.
Solution: The error message should advise you on the specific error made. Check the documentation for the specific API method you are calling and make sure you are sending valid and complete parameters. You may also need to check the encoding, format, or size of your request data.

The solution depends on the OpenAI API endpoint you want to use. Check the documentation and be careful to make your API request correctly. See the documentation links for the relevant API endpoint you're using:

Your case

In your case (i.e., Fine-tuning API endpoint), change this...

openai.File.create

...to this.

openai.FineTuningJob.create

Also, the training_file and model parameters are required. See the official OpenAI documentation.

Screenshot

Try the following:

test.py

import os
import openai

openai.api_key = os.getenv("OPENAI_API_KEY")

openai.FineTuningJob.create(training_file="file-abc123", model="gpt-3.5-turbo")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.