最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure aks - Document Intelligence Custom Template AKS deployment - Stack Overflow

programmeradmin5浏览0评论

I am following this documentation to deploy a custom document intelligence container to AKS.

.0.0&tabs=custom

I deployed the custom template image, layout image, and Nginx as the reverse proxy. I didn't deploy the document intelligence studio image as per the example as our team has already trained some models using Azure Document Intelligence Studio and wants to reuse those Model Id's.

But when I try to list the model using /form recognizer/documentModels, it does not list any custom models that we trained using Document Intelligence Studio outside the containerized environment. Both the document intelligence studio and custom container share the same subscription, endpoint, and keys.

What am I missing here? how do the containerized custom templates api's have access to the custom models we trained using studio?

Note that in the logs I can see some errors like

formrecognizercustomsupervised[0]
      SubscriptionId could not be found.

My custom template yaml:

   spec:
      serviceAccountName: azurekeyvaultsecretsprovider
      containers:
        - name: azure-cognitive-service-custom-template
          image: mcr.microsoft/azure-cognitive-services/form-recognizer/custom-template-3.0:latest
          volumeMounts:
            - name: di-secrets
              mountPath: "/mnt/secrets-store"
              readOnly: true
            - name: shared
              mountPath: /share           
            - name: output
              mountPath: /logs
          ports:
            - containerPort: 5000
              protocol: TCP
          env:
            - name: AzureCognitiveServiceLayoutHost
              value: http://layout:5000
            - name: Logging__Console__LogLevel__Default
              value: Debug
            - name: Mounts__Output
              value: /logs
            - name: Mounts__Shared
              value: /share
            - name: SharedRootFolder
              value: /share
            - name: ASPNETCORE_ENVIRONMENT
              value: Development
            - name: EULA
              value: accept
            - name: BILLING
              valueFrom:
                secretKeyRef:
                  name: docintelsecrets
                  key: billingendpoint
            - name: APIKEY
              valueFrom:
                secretKeyRef:
                  name: docintelsecrets
                  key: apikey1

I am following this documentation to deploy a custom document intelligence container to AKS.

https://learn.microsoft/en-us/azure/ai-services/document-intelligence/containers/install-run?view=doc-intel-4.0.0&tabs=custom

I deployed the custom template image, layout image, and Nginx as the reverse proxy. I didn't deploy the document intelligence studio image as per the example as our team has already trained some models using Azure Document Intelligence Studio and wants to reuse those Model Id's.

But when I try to list the model using /form recognizer/documentModels, it does not list any custom models that we trained using Document Intelligence Studio outside the containerized environment. Both the document intelligence studio and custom container share the same subscription, endpoint, and keys.

What am I missing here? how do the containerized custom templates api's have access to the custom models we trained using studio?

Note that in the logs I can see some errors like

formrecognizercustomsupervised[0]
      SubscriptionId could not be found.

My custom template yaml:

   spec:
      serviceAccountName: azurekeyvaultsecretsprovider
      containers:
        - name: azure-cognitive-service-custom-template
          image: mcr.microsoft/azure-cognitive-services/form-recognizer/custom-template-3.0:latest
          volumeMounts:
            - name: di-secrets
              mountPath: "/mnt/secrets-store"
              readOnly: true
            - name: shared
              mountPath: /share           
            - name: output
              mountPath: /logs
          ports:
            - containerPort: 5000
              protocol: TCP
          env:
            - name: AzureCognitiveServiceLayoutHost
              value: http://layout:5000
            - name: Logging__Console__LogLevel__Default
              value: Debug
            - name: Mounts__Output
              value: /logs
            - name: Mounts__Shared
              value: /share
            - name: SharedRootFolder
              value: /share
            - name: ASPNETCORE_ENVIRONMENT
              value: Development
            - name: EULA
              value: accept
            - name: BILLING
              valueFrom:
                secretKeyRef:
                  name: docintelsecrets
                  key: billingendpoint
            - name: APIKEY
              valueFrom:
                secretKeyRef:
                  name: docintelsecrets
                  key: apikey1
Share Improve this question edited Feb 14 at 19:41 ssilas777 asked Feb 4 at 23:01 ssilas777ssilas777 9,7644 gold badges46 silver badges69 bronze badges 9
  • Have you added env in Kubernetes Deployment YAML envFrom: - configMapRef: name: my-config - secretRef: name: my-secrets – Sampath Commented Feb 5 at 12:53
  • if you mean env var's like billing, api key etc.. yes they are all passed and also container is running – ssilas777 Commented Feb 5 at 14:20
  • I mean adding in yaml/ call env in yml as well. – Sampath Commented Feb 5 at 14:23
  • Right, they are part of the deployment yaml – ssilas777 Commented Feb 5 at 14:36
  • Have you added env them in yml as well and during deployement with yml have you called env as well – Sampath Commented Feb 5 at 14:39
 |  Show 4 more comments

1 Answer 1

Reset to default 0

To use custom models trained in Azure Document Intelligence Studio with the containerized environment:

Export the Model: Export the model from Azure Document Intelligence Studio as a .z file.

Load the Model into the Container: Mount the .z file into the container and configure it to use the model:

docker run -d \
-p 5000:5000 \
-v /path/to/models:/app/models \
-e MODEL_ID=your-model-id \
-e MODEL_PATH=/app/models/your-model-file.z \
your-container-image

Verify:

Query /formrecognizer/documentModels to confirm the model is listed.

The container operates offline and won’t automatically sync with Azure Studio models. Export and load the models manually. Might work its how i use it.

发布评论

评论列表(0)

  1. 暂无评论