-1

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

Rok Benko
  • 14,265
  • 2
  • 24
  • 49
Teekay
  • 1
  • 1
  • 1

1 Answers1

1

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.

Change openai.File.create to openai.FineTune.create. Also, the training_file parameter is required. See the documentation.

Screenshot

test.py

import os
import openai

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

openai.FineTune.create(training_file="file-XGinujblHPwGLSztz8cPS8XY")
Rok Benko
  • 14,265
  • 2
  • 24
  • 49