@@ -7,7 +7,7 @@ author: msakande
7
7
reviewer : santiagxf
8
8
ms.service : azure-ai-model-inference
9
9
ms.topic : how-to
10
- ms.date : 01/22 /2025
10
+ ms.date : 03/17 /2025
11
11
ms.author : mopeakande
12
12
ms.reviewer : fasantia
13
13
ms.custom : generated
@@ -41,7 +41,7 @@ import os
41
41
from azure.ai.inference import ImageEmbeddingsClient
42
42
from azure.core.credentials import AzureKeyCredential
43
43
44
- model = ImageEmbeddingsClient(
44
+ client = ImageEmbeddingsClient(
45
45
endpoint = os.environ[" AZURE_INFERENCE_ENDPOINT" ],
46
46
credential = AzureKeyCredential(os.environ[" AZURE_INFERENCE_CREDENTIAL" ]),
47
47
model = " Cohere-embed-v3-english"
@@ -55,7 +55,7 @@ import os
55
55
from azure.ai.inference import ImageEmbeddingsClient
56
56
from azure.identity import DefaultAzureCredential
57
57
58
- model = ImageEmbeddingsClient(
58
+ client = ImageEmbeddingsClient(
59
59
endpoint = os.environ[" AZURE_INFERENCE_ENDPOINT" ],
60
60
credential = DefaultAzureCredential(),
61
61
model = " Cohere-embed-v3-english"
@@ -70,7 +70,7 @@ To create image embeddings, you need to pass the image data as part of your requ
70
70
from azure.ai.inference.models import ImageEmbeddingInput
71
71
72
72
image_input= ImageEmbeddingInput.load(image_file = " sample1.png" , image_format = " png" )
73
- response = model .embed(
73
+ response = client .embed(
74
74
input = [ image_input ],
75
75
)
76
76
```
@@ -102,7 +102,7 @@ Some models can generate embeddings from images and text pairs. In this case, yo
102
102
``` python
103
103
text_image_input= ImageEmbeddingInput.load(image_file = " sample1.png" , image_format = " png" )
104
104
text_image_input.text = " A cute baby sea otter"
105
- response = model .embed(
105
+ response = client .embed(
106
106
input = [ text_image_input ],
107
107
)
108
108
```
@@ -117,7 +117,7 @@ The following example shows how to create embeddings that are used to create an
117
117
``` python
118
118
from azure.ai.inference.models import EmbeddingInputType
119
119
120
- response = model .embed(
120
+ response = client .embed(
121
121
input = [ image_input ],
122
122
input_type = EmbeddingInputType.DOCUMENT ,
123
123
)
@@ -129,7 +129,7 @@ When you work on a query to retrieve such a document, you can use the following
129
129
``` python
130
130
from azure.ai.inference.models import EmbeddingInputType
131
131
132
- response = model .embed(
132
+ response = client .embed(
133
133
input = [ image_input ],
134
134
input_type = EmbeddingInputType.QUERY ,
135
135
)
0 commit comments