You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can get sample audio files from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
39
+
You can get sample audio files, such as *wikipediaOcelot.wav*, from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
40
40
41
41
> [!IMPORTANT]
42
-
> For production, use a secure way of storing and accessing your credentials like[The PowerShell Secret Management with Azure Key Vault](/powershell/utility-modules/secretmanagement/how-to/using-azure-keyvault). For more information about credential security, see the Azure AI services [security](../../security-features.md) article.
42
+
> For production, store and access your credentials using a secure method, such as[The PowerShell Secret Management with Azure Key Vault](/powershell/utility-modules/secretmanagement/how-to/using-azure-keyvault). For more information about credential security, see [Azure AI services security](../../security-features.md).
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/whisper-python.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ ms.date: 3/19/2024
11
11
12
12
### Prerequisites
13
13
14
-
-<ahref="https://www.python.org/"target="_blank">Python 3.8 or later version</a>
15
-
- The following Python libraries: os
14
+
-[Python 3.8 or later](https://www.python.org)
15
+
- The following Python library: os
16
16
17
17
### Set up
18
18
@@ -34,9 +34,9 @@ pip install openai==0.28.1
34
34
35
35
---
36
36
37
-
1. Create a new Python file called quickstart.py. Then open it up in your preferred editor or IDE.
37
+
1. Create a new Python file called *quickstart.py*. Then open it up in your preferred editor or IDE.
38
38
39
-
1. Replace the contents of quickstart.py with the following code. Modify the code to add your deployment name:
39
+
1. Replace the contents of *quickstart.py* with the following code. Modify the code to add your deployment name:
40
40
41
41
# [OpenAI Python 1.x](#tab/python-new)
42
42
@@ -63,8 +63,6 @@ pip install openai==0.28.1
63
63
64
64
# [OpenAI Python 0.28.1](#tab/python)
65
65
66
-
67
-
68
66
```python
69
67
import openai
70
68
import time
@@ -92,13 +90,16 @@ pip install openai==0.28.1
92
90
93
91
---
94
92
95
-
Run the application with the python command on your quickstart file:
93
+
Run the application using the `python` command on your quickstart file:
96
94
95
+
```python
96
+
python quickstart.py
97
+
```
97
98
98
-
You can get sample audio files from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
99
+
You can get sample audio files, such as *wikipediaOcelot.wav*, from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
99
100
100
101
> [!IMPORTANT]
101
-
> For production, use a secure way of storing and accessing your credentials like[Azure Key Vault](/azure/key-vault/general/overview). For more information about credential security, see the Azure AI services [security](../../security-features.md) article.
102
+
> For production, store and access your credentials using a secure method, such as[Azure Key Vault](/azure/key-vault/general/overview). For more information about credential security, see [Azure AI services security](../../security-features.md).
The format of your first line of the command with an example endpoint would appear as follows`curl https://aoai-docs.openai.azure.com/openai/deployments/{YourDeploymentName}/audio/transcriptions?api-version=2024-02-01 \`.
23
+
The first line of the preceding command with an example endpoint would appear as follows:
24
24
25
-
You can get sample audio files from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
You can get sample audio files, such as *wikipediaOcelot.wav*, from the [Azure AI Speech SDK repository at GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/sampledata/audiofiles).
26
30
27
31
> [!IMPORTANT]
28
-
> For production, use a secure way of storing and accessing your credentials like[Azure Key Vault](/azure/key-vault/general/overview). For more information about credential security, see the Azure AI services [security](../../security-features.md) article.
32
+
> For production, store and access your credentials using a secure method, such as[Azure Key Vault](/azure/key-vault/general/overview). For more information about credential security, see [Azure AI services security](../../security-features.md).
# Quickstart: Speech to text with the Azure OpenAI Whisper model
18
18
19
-
In this quickstart, you use the Azure OpenAI Whisper model for speech to text.
19
+
This quickstart explains how to use the [Azure OpenAI Whisper model](../speech-service/whisper-overview.md) for speech to text conversion. The Whisper model can transcribe human speech in numerous languages, and it can also translate other languages into English.
20
20
21
-
The file size limit for the Azure OpenAI Whisper model is 25 MB. If you need to transcribe a file larger than 25 MB, you can use the Azure AI Speech [batch transcription](../speech-service/batch-transcription-create.md#use-a-whisper-model) API.
21
+
The file size limit for the Whisper model is 25 MB. If you need to transcribe a file larger than 25 MB, you can use the Azure AI Speech [batch transcription](../speech-service/batch-transcription-create.md#use-a-whisper-model) API.
22
+
23
+
> [!NOTE]
24
+
> The OpenAI Whisper model is currently in Limited Access Public Preview.
22
25
23
26
## Prerequisites
24
27
25
-
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true).
26
-
- An Azure OpenAI resource with a `whisper` model deployed in a supported region. [Whisper model regional availability](./concepts/models.md#whisper-models). For more information, see [Create a resource and deploy a model with Azure OpenAI](how-to/create-resource.md).
28
+
- An Azure subscription. You can [create one for free](https://azure.microsoft.com/free/cognitive-services?azure-portal=true).
29
+
- An Azure OpenAI resource with a Whisper model deployed in a [supported region](./concepts/models.md#whisper-models). For more information, see [Create a resource and deploy a model with Azure OpenAI](how-to/create-resource.md).
27
30
28
31
## Set up
29
32
30
33
### Retrieve key and endpoint
31
34
32
-
To successfully make a call against Azure OpenAI, you'll need an **endpoint** and a **key**.
35
+
To successfully make a call against Azure OpenAI, you need an *endpoint* and a *key*.
33
36
34
37
|Variable name | Value |
35
38
|--------------------------|-------------|
@@ -105,5 +108,5 @@ If you want to clean up and remove an Azure OpenAI resource, you can delete the
105
108
106
109
## Next steps
107
110
108
-
*Learn more about how to work with Whisper models with the Azure AI Speech [batch transcription](../speech-service/batch-transcription-create.md) API.
109
-
* For more examples, check out the [Azure OpenAI Samples GitHub repository](https://aka.ms/AOAICodeSamples)
111
+
*To learn how to convert audio data to text in batches, see [Create a batch transcription](../speech-service/batch-transcription-create.md).
112
+
* For more examples, check out the [Azure OpenAI Samples GitHub repository](https://aka.ms/AOAICodeSamples).
0 commit comments