How do i fixed openai.BadRequestError: Error code: 400 - {'error': {'code': 'invalidPayload', 'message': 'The specified file reference must point to a completed file import.'}}

Vivek Hareshbhai Dabhi 0 Reputation points
2024-11-12T12:23:40.6+00:00

How do i fixed openai.BadRequestError: Error code: 400 - {'error': {'code': 'invalidPayload', 'message': 'The specified file reference must point to a completed file import.'}}

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,974 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Pavankumar Purilla 1,805 Reputation points Microsoft Vendor
    2024-11-13T00:11:54.4266667+00:00

    Hi Vivek Hareshbhai Dabhi,
    Greetings & Welcome to the Microsoft Q&A forum! Thank you for posting your query!
    The error you're encountering indicates that the file you are trying to use for fine-tuning has not been fully processed and marked as completed in Azure OpenAI. For fine-tuning, the service requires files to be properly uploaded, validated, and ready for use.
    User's image I have attempted to reproduce the scenario, and it worked for me. Here is the output:

    Job ID: ftjob-44c71d21f6b64327a4e2a3670d0cc2bb Status: pending { "id": "ftjob-44c71d21f6b64327a4e2a3670d0cc2bb", "created_at": 1731456080, "error": null, "fine_tuned_model": null, "finished_at": null, "hyperparameters": { "n_epochs": -1, "batch_size": -1, "learning_rate_multiplier": 1 }, "model": "gpt-4o-mini-2024-07-18", "object": "fine_tuning.job", "organization_id": null, "result_files": null, "seed": 105, "status": "pending", "trained_tokens": null, "training_file": "file-52604e59b74a40a2819db5563fed5557", "validation_file": "file-2e06279e192e4d4391b943006e5dfb31", "estimated_finish": 1731456980, "integrations": null }
    

    Actually, you can leverage Azure Open AI Studio to validate your data as this document - https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/fine-tuning?tabs=turbo%2Cpython-new&pivots=programming-language-studio#prepare-your-training-and-validation-data.
    Additionally, refer to this Azure OpenAI GPT-4o-mini fine-tuning tutorial for step-by-step guidance.

    Your training data and validation data sets consist of input and output examples for how you would like the model to perform. Different model types require a different format of training data.

    Please take a look at the document and let us know if you have any questions.

    If you continue to experience difficulties, please feel free to reach out and will escalate the issue to the appropriate team to ensure it is resolved promptly.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.


  2. Vivek Hareshbhai Dabhi 0 Reputation points
    2024-11-13T06:51:39.87+00:00

    To track the status, I added the following function. This will allow me to receive the exact response in JSON format.

    0 comments No comments

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.