Skip to content

Commit f1ae6a1

Browse files
committed
formatting issues
1 parent 56d2220 commit f1ae6a1

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

articles/ai-foundry/model-inference/how-to/use-image-to-text.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ ms.custom: references_regions, tool_generated
1414
zone_pivot_groups: azure-ai-inference-samples
1515
---
1616

17+
# How to generate images with Azure AI model inference
18+
1719
This article explains how to generate images with _image_ models deployed to Azure AI model inference in Azure AI services. Some models have unique parameters or data format requirements.
1820

1921
## Prerequisites
@@ -22,51 +24,49 @@ To use image models in your application, you need:
2224

2325
[!INCLUDE [how-to-prerequisites](../includes/how-to-prerequisites.md)]
2426

25-
* An image model deployment. If you don't have one, see [Add and configure models to Azure AI services](../../how-to/create-model-deployments.md) to add an image model to your resource.
26-
27-
* This article uses `Mistral OCR`.
27+
* An image model deployment. If you don't have one, see [Add and configure models to Azure AI model inference](create-model-deployments.md) to add an image model to your resource. This article uses the Mistral OCR model.
2828

2929
## Use image model
3030

3131
1. Authenticate using API key. For serverless API endpoints, deploy the model to generate the endpoint URL and an API key to authenticate against the service. In this example, the endpoint and key are strings holding the endpoint URL and the API key. The API endpoint URL and API key can be found on the **Deployments + Endpoint** page once the model is deployed.
3232

33-
If you're using bash:
34-
35-
```
36-
export AZURE_API_KEY = "<your-api-key>"
37-
```
38-
39-
If you're in powershell:
40-
41-
```
42-
$Env:AZURE_API_KEY = "<your-api-key>"
43-
```
44-
45-
If you're using Windows command prompt:
33+
If you're using bash:
34+
35+
```
36+
export AZURE_API_KEY = "<your-api-key>"
37+
```
38+
39+
If you're in powershell:
4640
47-
```
48-
export AZURE_API_KEY = "<your-api-key>"
49-
```
41+
```
42+
$Env:AZURE_API_KEY = "<your-api-key>"
43+
```
44+
45+
If you're using Windows command prompt:
46+
47+
```
48+
export AZURE_API_KEY = "<your-api-key>"
49+
```
5050
5151
1. Run a basic code sample. Paste the following code into a shell.
5252
53-
> [!NOTE]
54-
> Different image models accept different data formats. In this example, `Mistral OCR 25.03` supports only base64 data. Document url or image url isn't supported.
55-
56-
```http
57-
curl --request POST \
58-
--url https://<your_serverless_endpoint>/v1/ocr \
59-
--header 'Authorization: <api_key>' \
60-
--header 'Content-Type: Application/json' \
61-
--data '{
62-
"model": "mistral-ocr-2503",
63-
"document": {
64-
"type": "document_url",
65-
"document_name": "test",
66-
"document_url": "data:application/pdf;base64,JVBER..."
67-
}
68-
}'
69-
```
53+
> [!NOTE]
54+
> Different image models accept different data formats. In this example, `Mistral OCR 25.03` supports only base64 data. Document url or image url isn't supported.
55+
56+
```http
57+
curl --request POST \
58+
--url https://<your_serverless_endpoint>/v1/ocr \
59+
--header 'Authorization: <api_key>' \
60+
--header 'Content-Type: Application/json' \
61+
--data '{
62+
"model": "mistral-ocr-2503",
63+
"document": {
64+
"type": "document_url",
65+
"document_name": "test",
66+
"document_url": "data:application/pdf;base64,JVBER..."
67+
}
68+
}'
69+
```
7070
7171
## Model specific requirements
7272

0 commit comments

Comments
 (0)