Share via

HttpResponseError: (1001) Specified model not found or not ready, Model Id: bsps_trial

Vignesh Ramakrishnan 1 Reputation point
2022-08-08T08:20:23.187+00:00

endpoint = "https://cog-formrecogniser-dwh-dev-dv6-01.cognitiveservices.azure.com/"
credential = AzureKeyCredential("********************************")
model_id = "bsps_trial"

formUrl = 'https://stdwhdevdv601.blob.core.windows.net/c-raw/Defaults/BSPS_Trial/NonCustomer/Batch1/ZP174889C/Profund/2584711.pdf'

form_recognizer_client = FormRecognizerClient(endpoint, credential)
poller = form_recognizer_client.begin_recognize_custom_forms_from_url(model_id, formUrl)

result = poller.result()


Note: We are using the same model in FormRecognizer studio, we tried few different naming conventions as well.

Azure Document Intelligence in Foundry Tools

1 answer

Sort by: Most helpful
  1. Rohit Mungi 49,131 Reputation points Microsoft Employee Moderator
    2022-09-02T06:38:06.15+00:00

    @Vignesh Ramakrishnan You are most likely using a model created with the latest version of form recognizer API from the studio but the SDK client above is trying to pickup the model id from the previous versions so the error not found message is seen. Please see this thread for a similar discussion.
    You will have to use the DocumentModelAdministrationClient to list the models and then use the same client to run the analyze method.

         from azure.core.credentials import AzureKeyCredential  
         from azure.core.exceptions import ResourceNotFoundError  
         from azure.ai.formrecognizer import DocumentModelAdministrationClient, ModelBuildMode  
          
         endpoint = os.environ["AZURE_FORM_RECOGNIZER_ENDPOINT"]  
         key = os.environ["AZURE_FORM_RECOGNIZER_KEY"]  
         container_sas_url = os.environ["CONTAINER_SAS_URL"]  
          
         # [START get_resource_details]  
         document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))  
          
         account_info = document_model_admin_client.get_resource_details()  
         print("Our resource has {} custom models, and we can have at most {} custom models\n".format(  
             account_info.document_model_count, account_info.document_model_limit  
         ))  
         # [END get_resource_details]  
          
         # Next, we get a paged list of all of our custom models  
         # [START list_models]  
         models = document_model_admin_client.list_models()  
    

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    Was this answer helpful?

    0 comments No comments

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.