Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

2024-03-11T10:48:42.49+00:00

I am getting following error / openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}} ; when i try Begin fine-tuning after uploading fine-tuning files, i tried using other api_version as well-

import os
from openai import AzureOpenAI


# Setting environment variables directly for testing purposes
os.environ['AZURE_OPENAI_KEY'] = 'xxxxxxxxx'
os.environ['AZURE_OPENAI_ENDPOINT'] = 'https://xxxxxxxxx.openai.azure.com/' 


client = AzureOpenAI(
    azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT"),
    api_key=os.getenv("AZURE_OPENAI_KEY"),
    api_version="2023-05-15"  
)


training_file_id = 'file-xxxxxxx'
validation_file_id = 'file-xxxxxxx'

# Submit the fine-tuning job
response = client.fine_tuning.jobs.create(
    training_file=training_file_id,
    validation_file=validation_file_id,
    model="gpt-35-turbo",
)

job_id = response.id

print("Job ID:", job_id)
print("Status:", response.status)

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,052 questions
{count} vote

Accepted answer
  1. Charlie Wei 3,320 Reputation points
    2024-03-13T02:53:44.71+00:00

    Hello Banarase, Soham Rajendra (T SSP DAB-DE),

    According to the Microsoft Learn document, the comments in the example code mention that fine-tuning the turbo model requires at least API version 2023-12-01-preview. You can attempt to modify the api_version as follows.

    import os
    from openai import AzureOpenAI
    
    client = AzureOpenAI(
      azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"), 
      api_key=os.getenv("AZURE_OPENAI_API_KEY"),  
      api_version="2023-12-01-preview"  # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
    )
    

    Best regards,
    Charlie


    If you find my response helpful, please consider accepting this answer and voting 'yes' to support the community. Thank you!

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.