Azure Document Intelligence "code": "ModelNotFound",

Vincent Primiani 0 Reputation points
2024-04-16T17:20:31.0666667+00:00

I'm getting the below error ;

ResourceNotFoundError: (NotFound) Resource not found. Code: NotFound Message: Resource not found. Inner error: { "code": "ModelNotFound", "message": "The requested model was not found." }

running this code

import os
from azure.core.credentials import AzureKeyCredential
from azure.ai.documentintelligence import DocumentIntelligenceClient
# Replace with your actual endpoint and key
endpoint = "https://xxx.cognitiveservices.azure.com"
key = ""
# Initialize the client with the preview API version
document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key), api_version="2024-02-29-preview")
# Path to the sample document (PDF, image, etc.)
path_to_sample_document = "/content/overpay uhc-04042024125510.pdf"
# Replace "custom-model-id" with your actual custom model ID
custom_model_id = "type-classification-V1.1"
# Analyze the document using your custom model
with open(path_to_sample_document, "rb") as f:
    poller = document_intelligence_client.begin_analyze_document(custom_model_id, analyze_request=f, content_type="application/octet-stream")
    result = poller.result()
Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,508 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Claudio Pincheira 5 Reputation points
    2024-05-30T22:03:58.8666667+00:00

    I faced the same problem and solved it by performing two actions:

    1. Configure the endpoint and key directly in the model (Settings). Use the same values ​​that appear in my resource created for the model.
    2. User's image
    3. Then use this code
    1 person found this answer helpful.
    0 comments No comments

  2. 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.


    Comments have been turned off. Learn more