Skip to content

Commit 37dd728

Browse files
Merge pull request #233387 from mrbullwinkle/mrb_04_04_2023_embeddings_updates
[Cognitive Services] [Azure OpenAI] Update to clarify batching is not supported
2 parents 00e13fd + 5368940 commit 37dd728

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

articles/cognitive-services/openai/faq.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
ms.service: cognitive-services
99
ms.subservice: openai
1010
ms.topic: faq
11-
ms.date: 03/21/2023
11+
ms.date: 04/04/2023
1212
ms.author: mbullwin
1313
author: mrbullwinkle
1414
title: Azure OpenAI Service frequently asked questions
@@ -45,8 +45,10 @@ sections:
4545
How do I apply for new use cases?
4646
answer: |
4747
Previously, the process for adding new use cases required customers to reapply to the service. Now, we're releasing a new process that allows you to quickly add new use cases to your use of the service. This process follows the established Limited Access process within Azure Cognitive Services. [Existing customers can attest to any and all new use cases here](https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7en2Ais5pxKtso_Pz4b1_xUM003VEJPRjRSOTZBRVZBV1E5N1lWMk1XUyQlQCN0PWcu). Please note that this is required anytime you would like to use the service for a new use case you did not originally apply for.
48-
49-
48+
- question: |
49+
I am trying to use embeddings and received the error "InvalidRequestError: Too many inputs. The max number of inputs is 1." How do I fix this?
50+
answer: |
51+
This error typically occurs when you try to send a batch of text to embed in a single API request as an array. Currently Azure OpenAI does not support batching with embedding requests. Embeddings API calls should consist of a single string input per request. The string can be up to 8191 tokens in length when using the text-embedding-ada-002 (Version 2) model.
5052
- name: Getting access to Azure OpenAI Service
5153
questions:
5254
- question: |

articles/cognitive-services/openai/reference.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: nitinme
77
ms.service: cognitive-services
88
ms.subservice: openai
99
ms.topic: conceptual
10-
ms.date: 03/21/2023
10+
ms.date: 04/04/2023
1111
author: mrbullwinkle
1212
ms.author: mbullwin
1313
recommendations: false
@@ -113,6 +113,9 @@ In the example response, `finish_reason` equals `stop`. If `finish_reason` equal
113113
## Embeddings
114114
Get a vector representation of a given input that can be easily consumed by machine learning models and other algorithms.
115115

116+
> [!NOTE]
117+
> We currently do not support batching of embeddings into a single API call. If you receive the error `InvalidRequestError: Too many inputs. The max number of inputs is 1. We hope to increase the number of inputs per request soon.`, this typically occurs when an array of embeddings is attempted to be passed as a batch rather than a single string. The string can be up to 8191 tokens in length when using the text-embedding-ada-002 (Version 2) model.
118+
116119
**Create an embedding**
117120

118121
```http
@@ -136,7 +139,7 @@ POST https://{your-resource-name}.openai.azure.com/openai/deployments/{deploymen
136139

137140
| Parameter | Type | Required? | Default | Description |
138141
|--|--|--|--|--|
139-
| ```input```| string or array | Yes | N/A | Input text to get embeddings for, encoded as a string or array of tokens. To get embeddings for multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed 2048 tokens in length. Currently we accept a max array of 1. <br> Unless you're embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present.|
142+
| ```input```| string | Yes | N/A | Input text to get embeddings for, encoded as a string. The number of input tokens varies depending on what [model you are using](./concepts/models.md). <br> Unless you're embedding code, we suggest replacing newlines (\n) in your input with a single space, as we have observed inferior results when newlines are present.|
140143
| ```user``` | string | No | Null | A unique identifier representing for your end-user. This will help Azure OpenAI monitor and detect abuse. **Do not pass PII identifiers instead use pseudoanonymized values such as GUIDs** |
141144

142145
#### Example request

0 commit comments

Comments
 (0)