Can't upload file through API

Zandarashvili, Levani 0 Reputation points
2024-11-21T20:13:43.6+00:00

I'm trying to upload files to Azure for fine-tuning, but I'm getting resource not available error.
I know that the client I creates is fine, because I tested it with the chat option. For example, if I run the following using my client:

client.chat.completions.create(
    messages=[{"content": "What is the weather like today?", "role": "user"}], model="gpt-4o"
)

It will work fine, but when I try to run a command to upload a file:

client.files.create(file=open("messages/train_messages.jsonl", "rb"), purpose="fine-tune")

It gives me an error: NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}

Azure OpenAI in Foundry Models

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

Your answer

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