Can't upload file for fine tuning 3.5. Data format is okay

I can’t upload the file. I have never done this before. I have always used the CLI method to finetune GPT 3. But reading the instructions for 3.5 it’s clear we have to upload the file first .

I am having trouble doing this. I run my file which looks like below but nothing happens. As in I don’t see anything in the console as a response. The data format is fine I checked it with the OpenAi script. What am I doing wrong?

import os
import openai
openai.api_key = "key"
openai.File.create(
  file=open("output.jsonl", "rb"),
  purpose='fine-tune'
)
 

What is this “CLI method” I wonder? A file upload of example answer completions was required.

Reminder, newest openai module is required:

These models can be fine-tuned with our new API endpoint /v1/fine_tuning/jobs. This new endpoint offers pagination and more extensibility to support the future evolution of the fine-tuning API.

Check your prerequisites:
python 3.7-3.9
pip install --upgrade openai

Install both python and its modules either as administrator/root (“for all users” and “as administrator”), or for just the local user.

You can use the full path of the file name if you are unsure it is found.

Here’s how to list your uploaded files, and lower on the page, curl upload procedure. https://platform.openai.com/docs/api-reference/files/list

1 Like

You can use the command like if you wish, with CURL

curl https://api.openai.com/v1/files \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "purpose=fine-tune" \
  -F "file=@path_to_your_file"

taken from

1 Like