Fine_tuning.jobs.create complains "method" is not a keyword

I am finetuning the vision model

Example is:

from openai import OpenAI
client = OpenAI()

client.fine_tuning.jobs.create(
training_file=“file-abc123”,
model=“gpt-4o-mini”,
method={
“type”: “supervised”,
“supervised”: {
“hyperparameters”: {
“n_epochs”: 2
}
}
}
)

I get an error:
client.fine_tuning.jobs.create(
TypeError: Jobs.create() got an unexpected keyword argument ‘method’

Notice how you were blocked, but no 400 Bad Request?

The OpenAI library doesn’t validate what you are trying to send.

An update to the latest version with pip install --upgrade openai will let it pass.

I am not sure what you meant with “Notice how you were blocked, but no 400 Bad Request?”, but the upgrade fixed it! Thank you!

1 Like

Meaning:

If you were to send an API parameter that the endpoint doesn’t understand, you would be receiving a network error.

The API call didn’t get that far, because the OpenAI library has a list of what is (or was) accepted. That is what blocked you - your local library. It becomes quickly obsolete.

Glad it was resolved so simply!