Exception has occurred: InvalidRequestError That model does not exist

I get the following error:

Exception has occurred: InvalidRequestError
That model does not exist
File “C:\Users\richard.carr\OneDrive\Work\Engineering Applied AI\Proof of concept\ProofOfConcept.py”, line 63, in
response = openai.Completion.create(
openai.error.InvalidRequestError: That model does not exist

When I run the following code:

response = openai.Completion.create(
model=“ft-IuXUDXY8bRESPVeLavLasBOI”,
prompt=“Toggle the motor using start and stop pushbuttons”,
temperature=0.0,
max_tokens=50,
top_p=1,
frequency_penalty=1.0,
presence_penalty=0.5,
)

Here is the result from FineTune.list()

{
“data”: [
{
“created_at”: 1676958934,
“fine_tuned_model”: “curie:ft-personal-2023-02-21-06-02-47”,
“hyperparams”: {
“batch_size”: 1,
“learning_rate_multiplier”: 0.1,
“n_epochs”: 4,
“prompt_loss_weight”: 0.01
},
“id”: “ft-IuXUDXY8bRESPVeLavLasBOI”,
“model”: “curie”,
“object”: “fine-tune”,
“organization_id”: “org-oswtueduy5jfxmOXKy8xT4Ix”,
“result_files”: [
{
“bytes”: 353,
“created_at”: 1676959367,
“filename”: “compiled_results.csv”,
“id”: “file-K4zeiIQlZJLCzjdhQYsEoVds”,
“object”: “file”,
“purpose”: “fine-tune-results”,
“status”: “processed”,
“status_details”: null
}
],
“status”: “succeeded”,
“training_files”: [
{
“bytes”: 188,
“created_at”: 1676958934,
“filename”: “C:\Users\richard.carr\OneDrive\Work\Engineering Applied AI\Proof of concept\FineTuneingTrainingData.jsonl”,
“id”: “file-85YVbGOB3sT3IxkKhehGwVTm”,
“object”: “file”,
“purpose”: “fine-tune”,
“status”: “processed”,
“status_details”: null
}
],
“updated_at”: 1676959368,
“validation_files”:
},
{
“created_at”: 1676960418,
“fine_tuned_model”: “curie:ft-personal-2023-02-21-06-29-01”,
“hyperparams”: {
“batch_size”: 1,
“learning_rate_multiplier”: 0.1,
“n_epochs”: 4,
“prompt_loss_weight”: 0.01
},
“id”: “ft-CAAMA0R9Zwms4PswdAbIThJv”,
“model”: “curie”,
“object”: “fine-tune”,
“organization_id”: “org-oswtueduy5jfxmOXKy8xT4Ix”,
“result_files”: [
{
“bytes”: 2617,
“created_at”: 1676960942,
“filename”: “compiled_results.csv”,
“id”: “file-GHvrqx9xL0qOUUY2ZHFaSCEw”,
“object”: “file”,
“purpose”: “fine-tune-results”,
“status”: “processed”,
“status_details”: null
}
],
“status”: “succeeded”,
“training_files”: [
{
“bytes”: 2722,
“created_at”: 1676960417,
“filename”: “C:\Users\richard.carr\OneDrive\Work\Engineering Applied AI\Proof of concept\FineTuneingTrainingData.jsonl”,
“id”: “file-D70VU53QE8Wdg0AggG4qKpXS”,
“object”: “file”,
“purpose”: “fine-tune”,
“status”: “processed”,
“status_details”: null
}
],
“updated_at”: 1676960942,
“validation_files”:
}
],
“object”: “list”
}

Everything looks good to me…
What am I missing?
Any help would be greatly appreciated.

Hi @racarr202

You’re using finetune.id which is the job ID for when you submitted fine-tune request as model; when instead you be using fine_tuned_model as the model

2 Likes

I have the same error but when deleting a fine-tuning model. I’m doing:

print(openai.FineTune.list())
print(openai.Model.delete('davinci:ft-nextfem-2023-03-26-16-43-32'))

and I get:

{
  "data": [
    {
      "created_at": 1679848308,
      "fine_tuned_model": "davinci:ft-nextfem-2023-03-26-16-43-32",
      "hyperparams": {
... etc ...
 ],
  "object": "list"
}
Traceback (most recent call last):
  File "open.py", line 16, in <module>
    print(openai.Model.delete(FINE_TUNED_MODEL))
...
line 682, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model 'davinci:ft-nextfem-2023-03-26-16-43-32' does not exist

can you help?

You can only delete fine tuned model not a fine-tune job. Use the list models endpoint to list all available models