Skip to content

Commit e69ef4b

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into cold-tier
2 parents 61ea786 + 56dc699 commit e69ef4b

31 files changed

+522
-47
lines changed

articles/cognitive-services/Computer-vision/concept-model-customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The following table describes the limits on the scale of your custom model proje
7575
| Min # training images per category | 2 | 2 |
7676
| Max # tags per image | multiclass: 1 | NA |
7777
| Max # regions per image | NA | 1,000 |
78-
| Max # categories | 2,000 | 1,000 |
78+
| Max # categories | 2,500 | 1,000 |
7979
| Min # categories | 2 | 1 |
8080
| Max image size (Training) | 20 MB | 20 MB |
8181
| Max image size (Prediction) | Sync: 6 MB, Batch: 20 MB | Sync: 6 MB, Batch: 20 MB |

articles/cognitive-services/openai/concepts/models.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Azure OpenAI provides access to many different models, grouped by family and cap
2121
|--|--|
2222
| [GPT-4](#gpt-4-models) | A set of models that improve on GPT-3.5 and can understand as well as generate natural language and code. |
2323
| [GPT-3](#gpt-3-models) | A series of models that can understand and generate natural language. This includes the new [ChatGPT model](#chatgpt-gpt-35-turbo). |
24+
| [DALL-E](#dall-e-models) | A series of models that can generate original images from natural language. |
2425
| [Codex](#codex-models) | A series of models that can understand and generate code, including translating natural language to code. |
2526
| [Embeddings](#embeddings-models) | A set of models that can understand and use embeddings. An embedding is a special format of data representation that can be easily utilized by machine learning models and algorithms. The embedding is an information dense representation of the semantic meaning of a piece of text. Currently, we offer three families of Embeddings models for different functionalities: similarity, text search, and code search. |
2627

@@ -110,6 +111,10 @@ The ChatGPT model (gpt-35-turbo) is a language model designed for conversational
110111

111112
To learn more about the ChatGPT model and how to interact with the Chat API check out our [in-depth how-to](../how-to/chatgpt.md).
112113

114+
### DALL-E models
115+
116+
The DALL-E models, currently in preview, generate images from text prompts that the user provides.
117+
113118
## Codex models
114119

115120
The Codex models are descendants of our base GPT-3 models that can understand and generate code. Their training data contains both natural language and billions of lines of public code from GitHub.
@@ -214,6 +219,13 @@ These models can only be used with the Chat Completion API.
214219
<sup>1</sup> The model is [only available by request](https://aka.ms/oai/get-gpt4).<br>
215220
<sup>2</sup> Currently, only version `0314` of this model is available.
216221

222+
### Dall-E Models
223+
224+
| Model ID | Base model Regions | Fine-Tuning Regions | Max Request (characters) | Training Data (up to) |
225+
| --- | --- | --- | --- | --- |
226+
| dalle2 | East US | N/A | 400 | N/A |
227+
228+
217229
### Codex Models
218230

219231
These models can only be used with Completions API requests.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 'Quickstart - Generate an image using Azure OpenAI Service'
3+
titleSuffix: Azure OpenAI
4+
description: Walkthrough on how to get started with Azure OpenAI and make your first image generation call.
5+
services: cognitive-services
6+
manager: nitinme
7+
ms.service: cognitive-services
8+
ms.subservice: openai
9+
ms.topic: quickstart
10+
author: PatrickFarley
11+
ms.author: pafarley
12+
ms.date: 04/04/2023
13+
zone_pivot_groups: openai-quickstart-dall-e
14+
---
15+
16+
# Quickstart: Get started generating images using Azure OpenAI Service
17+
18+
19+
::: zone pivot="programming-language-studio"
20+
21+
[!INCLUDE [Studio quickstart](includes/dall-e-studio.md)]
22+
23+
::: zone-end
24+
25+
::: zone pivot="rest-api"
26+
27+
[!INCLUDE [REST API quickstart](includes/dall-e-rest.md)]
28+
29+
::: zone-end
30+
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: 'Quickstart: Use the OpenAI Service image generation REST APIs'
3+
titleSuffix: Azure OpenAI Service
4+
description: Walkthrough on how to get started with Azure OpenAI image generation using the REST API.
5+
services: cognitive-services
6+
manager: nitinme
7+
ms.service: cognitive-services
8+
ms.subservice: openai
9+
ms.topic: include
10+
ms.date: 04/04/2023
11+
keywords:
12+
---
13+
14+
Use this guide to get started calling the image generation REST APIs using Python.
15+
16+
## Prerequisites
17+
18+
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>
19+
- Access granted to DALL-E in the desired Azure subscription
20+
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Existing Azure OpenAI customers need to re-enter the form to get access to DALL-E. Open an issue on this repo to contact us if you have an issue.
21+
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>
22+
- The following Python libraries: os, requests, json
23+
- An Azure OpenAI resource created in the East US region. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
24+
25+
## Retrieve key and endpoint
26+
27+
To successfully call the Azure OpenAI APIs, you'll need the following:
28+
29+
|Variable name | Value |
30+
|--------------------------|-------------|
31+
| `ENDPOINT` | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. Alternatively, you can find the value in **Azure OpenAI Studio** > **Playground** > **Code View**. An example endpoint is: `https://docs-test-001.openai.azure.com/`.|
32+
| `API-KEY` | This value can be found in the **Keys & Endpoint** section when examining your resource from the Azure portal. You can use either `KEY1` or `KEY2`.|
33+
34+
Go to your resource in the Azure portal and select the **Keys and endpoint** page. Copy your endpoint and key to a temporary location. You can use either `KEY1` or `KEY2`. Always having two keys allows you to securely rotate and regenerate keys without causing a service disruption.
35+
36+
:::image type="content" source="../media/quickstarts/endpoint.png" alt-text="Screenshot of the overview blade for an OpenAI Resource in the Azure portal with the endpoint & access keys location circled in red." lightbox="../media/quickstarts/endpoint.png":::
37+
38+
## Create a new Python application
39+
40+
Create a new Python file called **quickstart.py**. Then open it up in your preferred code editor or IDE.
41+
42+
1. Replace the contents of **quickstart.py** with the following code. Enter your endpoint URL and key in the appropriate fields. Change the value of `"prompt"` to your own custom prompt.
43+
44+
```python
45+
import requests
46+
import time
47+
import os
48+
api_base = 'YOUR_API_ENDPOINT_URL'
49+
api_key = 'YOUR_OPENAI_KEY'
50+
api_version = '2023-06-01-preview'
51+
url = f"{api_base}openai/images/generations:submit?api-version={api_version}"
52+
headers= { "api-key": api_key, "Content-Type": "application/json" }
53+
body = {
54+
#"prompt": "USER_PROMPT_GOES_HERE",
55+
"prompt": "A painting of a dog",
56+
"resolution": "1024x1024",
57+
"n": 1
58+
}
59+
submission = requests.post(url, headers=headers, json=body)
60+
61+
operation_location = submission.headers['operation-location']
62+
status = ""
63+
while (status != "succeeded"):
64+
time.sleep(1)
65+
response = requests.get(operation_location, headers=headers)
66+
status = response.json()['status']
67+
image_url = response.json()['result']['data'][0]['url']
68+
```
69+
70+
> [!IMPORTANT]
71+
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials. For example, [Azure Key Vault](../../../key-vault/general/overview.md).
72+
73+
1. Run the application with the `python` command:
74+
75+
```console
76+
python quickstart.py
77+
```
78+
79+
The script will make an image generation API call and then loop until the generated image is ready.
80+
81+
## Output
82+
83+
The output from a successful image generation API call looks like this. The `"url"` field contains a URL where you can download the generated image. The URL stays active for 24 hours.
84+
85+
```json
86+
{
87+
"created": 1685130482,
88+
"expires": 1685216887,
89+
"id": "088e4742-89e8-4c38-9833-c294a47059a3",
90+
"result":
91+
{
92+
"data":
93+
[
94+
{
95+
"url": "<URL_TO_IMAGE>"
96+
}
97+
]
98+
},
99+
"status": "succeeded"
100+
}
101+
```
102+
103+
The image generation APIs come with a content moderation filter. If the service recognizes your prompt as harmful content, it won't return a generated image. For more information, see the [content filter](../concepts/content-filter.md) article. The system will return an operation status of `Failed` and the `error.code` in the message will be set to `contentFilter`. Here is an example.
104+
105+
```json
106+
{
107+
"created": 1589478378,
108+
"error": {
109+
"code": "contentFilter",
110+
"message": "Your task failed as a result of our safety system."
111+
},
112+
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
113+
"status": "failed"
114+
}
115+
```
116+
117+
It's also possible that the generated image itself is filtered. In this case, the error message is set to `Generated image was filtered as a result of our safety system.`. Here is an example.
118+
119+
```json
120+
{
121+
"created": 1589478378,
122+
"expires": 1589478399,
123+
"id": "9484f239-9a05-41ba-997b-78252fec4b34",
124+
"lastActionDateTime": 1589478378,
125+
"data": [
126+
{
127+
"url": "<URL_TO_IMAGE>"
128+
},
129+
{
130+
"error": {
131+
"code": "contentFilter",
132+
"message": "Generated image was filtered as a result of our safety system."
133+
}
134+
}
135+
],
136+
"status": "succeeded"
137+
}
138+
```
139+
140+
## Clean up resources
141+
142+
If you want to clean up and remove an OpenAI resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
143+
144+
- [Portal](../../cognitive-services-apis-create-account.md#clean-up-resources)
145+
- [Azure CLI](../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
146+
147+
## Next steps
148+
149+
* [Azure OpenAI Overview](../overview.md)
150+
* For more examples check out the [Azure OpenAI Samples GitHub repository](https://github.com/Azure/openai-samples).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: 'Quickstart: Use Azure OpenAI image generation with Azure AI Studio'
3+
titleSuffix: Azure OpenAI
4+
description: Walkthrough on how to get started with Azure OpenAI image generation in Azure AI Studio.
5+
services: cognitive-services
6+
manager: nitinme
7+
ms.service: cognitive-services
8+
ms.subservice: openai
9+
ms.topic: include
10+
ms.date: 04/04/2023
11+
keywords:
12+
---
13+
14+
Use this guide to get started generating images with Azure OpenAI in your browser.
15+
16+
## Prerequisites
17+
18+
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>.
19+
- Access granted to DALL-E in the desired Azure subscription.
20+
Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the form at <a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>. Existing Azure OpenAI customers need to re-enter the form to get access to DALL-E. Open an issue on this repo to contact us if you have an issue.
21+
- An Azure OpenAI resource created in the East US region. For more information about model deployment, see the [resource deployment guide](../how-to/create-resource.md).
22+
23+
## Go to the Azure AI Studio
24+
25+
Navigate to Azure AI Studio at <a href="https://oai.azure.com/" target="_blank">https://oai.azure.com/</a> and sign in with the credentials associated with your OpenAI resource. During or after the sign-in workflow, select the appropriate directory, Azure subscription, and Azure OpenAI resource.
26+
27+
From the Azure AI Studio landing page, select **DALL·E 2 playground** to use the image generation APIs.
28+
29+
## Try out image generation
30+
31+
Start exploring Azure OpenAI capabilities with a no-code approach through the DALL-E 2 playground. Enter your image prompt into the text box and select **Generate**. When the AI-generated image is ready, it will appear on the page.
32+
33+
> [!NOTE]
34+
> The image generation APIs come with a content moderation filter. If the service recognizes your prompt as harmful content, it won't return a generated image. For more information, see the [content filter](../concepts/content-filter.md) guide.
35+
36+
:::image type="content" source="../media/quickstarts/dall-e-studio.png" alt-text="Screenshot of the Azure AI Studio landing page." lightbox="../media/quickstarts/dall-e-studio.png":::
37+
38+
39+
In the DALL-E 2 playground, you can also view Python and cURL code samples, which are pre-filled according to your settings. Select **View code** near the top of the page. You can use this code to write an application that completes the same task.
40+
41+
## Clean up resources
42+
43+
If you want to clean up and remove an OpenAI resource, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
44+
45+
- [Portal](../../cognitive-services-apis-create-account.md#clean-up-resources)
46+
- [Azure CLI](../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
47+
48+
## Next steps
49+
50+
* [Azure OpenAI Overview](../overview.md)
51+
* For more examples check out the [Azure OpenAI Samples GitHub repository](https://github.com/Azure/openai-samples).
204 KB
Loading

articles/cognitive-services/openai/overview.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ keywords:
1616

1717
# What is Azure OpenAI Service?
1818

19-
Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-3, Codex and Embeddings model series. In addition, the new GPT-4 and ChatGPT (gpt-35-turbo) model series have now reached general availability. These models can be easily adapted to your specific task including but not limited to content generation, summarization, semantic search, and natural language to code translation. Users can access the service through REST APIs, Python SDK, or our web-based interface in the Azure OpenAI Studio.
19+
Azure OpenAI Service provides REST API access to OpenAI's powerful language models including the GPT-3, Codex and Embeddings model series. In addition, the new GPT-4 and ChatGPT (gpt-35-turbo) model series have now reached general availability. These models can be easily adapted to your specific task including but not limited to content generation, summarization, semantic search, and natural language to code translation. Users can access the service through REST APIs, Python SDK, or our web-based interface in the Azure AI Studio.
2020

2121
### Features overview
2222

@@ -27,7 +27,7 @@ Azure OpenAI Service provides REST API access to OpenAI's powerful language mode
2727
| Price | [Available here](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/) |
2828
| Virtual network support & private link support | Yes |
2929
| Managed Identity| Yes, via Azure Active Directory |
30-
| UI experience | **Azure Portal** for account & resource management, <br> **Azure OpenAI Service Studio** for model exploration and fine tuning |
30+
| UI experience | **Azure portal** for account & resource management, <br> **Azure OpenAI Service Studio** for model exploration and fine tuning |
3131
| Regional availability | East US <br> South Central US <br> West Europe <br> France Central |
3232
| Content filtering | Prompts and completions are evaluated against our content policy with automated systems. High severity content will be filtered. |
3333

@@ -55,7 +55,7 @@ With Azure OpenAI, customers get the security capabilities of Microsoft Azure wh
5555

5656
## Key concepts
5757

58-
### Prompts & Completions
58+
### Prompts & completions
5959

6060
The completions endpoint is the core component of the API service. This API provides access to the model's text-in, text-out interface. Users simply need to provide an input **prompt** containing the English text command, and the model will generate a text **completion**.
6161

@@ -130,6 +130,8 @@ The GPT-3 base models are known as Davinci, Curie, Babbage, and Ada in decreasin
130130

131131
The Codex series of models is a descendant of GPT-3 and has been trained on both natural language and code to power natural language to code use cases. Learn more about each model on our [models concept page](./concepts/models.md).
132132

133+
The DALL-E models, currently in preview, generate images from text prompts that the user provides.
134+
133135
## Next steps
134136

135137
Learn more about the [underlying models that power Azure OpenAI](./concepts/models.md).

articles/cognitive-services/openai/quotas-limits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ The following sections provide you with a quick guide to the quotas and limits t
2323
| Limit Name | Limit Value |
2424
|--|--|
2525
| OpenAI resources per region per Azure subscription | 3 |
26-
| Requests per minute per model* | Davinci-models (002 and later): 120 <br> ChatGPT model: 300 <br> GPT-4 models: 18 <br> All other models: 300 |
27-
| Tokens per minute per model* | Davinci-models (002 and later): 40,000 <br> ChatGPT model: 120,000 <br> GPT-4 8k model: 10,000 <br> GPT-4 32k model: 32,000 <br> All other models: 120,000 |
26+
| Request limits per model* | Davinci-models (002 and later): 120 per minute <br> ChatGPT model (preview): 300 per minute <br> GPT-4 models (preview): 18 per minute <br> DALL-E models (preview): 2 concurrent requests <br> All other models: 300 per minute |
27+
| Token limits per model* | Davinci-models (002 and later): 40,000 per minute <br> ChatGPT model: 120,000 per minute<br> GPT-4 8k model: 10,000 per minute<br> GPT-4 32k model: 32,000 per minute<br> All other models: 120,000 per minute|
2828
| Max fine-tuned model deployments* | 2 |
2929
| Ability to deploy same model to multiple deployments | Not allowed |
3030
| Total number of training jobs per resource | 100 |

0 commit comments

Comments
 (0)