Skip to content

Commit 849040e

Browse files
committed
1.x sdk default
1 parent c355e98 commit 849040e

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

articles/ai-services/openai/includes/whisper-python.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: mrbullwinkle
44
ms.author: mbullwin
55
ms.service: openai
66
ms.topic: include
7-
ms.date: 1/25/2024
7+
ms.date: 3/19/2024
88
---
99

1010
## Python
@@ -18,16 +18,16 @@ ms.date: 1/25/2024
1818

1919
Install the OpenAI Python client library with:
2020

21-
# [OpenAI Python 0.28.1](#tab/python)
21+
# [OpenAI Python 1.x](#tab/python-new)
2222

2323
```console
24-
pip install openai==0.28.1
24+
pip install openai
2525
```
2626

27-
# [OpenAI Python 1.x](#tab/python-new)
27+
# [OpenAI Python 0.28.1](#tab/python)
2828

2929
```console
30-
pip install openai
30+
pip install openai==0.28.1
3131
```
3232

3333
---
@@ -36,30 +36,30 @@ pip install openai
3636

3737
1. Replace the contents of quickstart.py with the following code. Modify the code to add your deployment name:
3838

39-
```python
40-
import openai
41-
import time
42-
import os
43-
44-
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
45-
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
46-
openai.api_type = "azure"
47-
openai.api_version = "2024-02-01"
48-
49-
model_name = "whisper"
50-
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
51-
audio_language="en"
52-
53-
audio_test_file = "./wikipediaOcelot.wav"
54-
55-
result = openai.Audio.transcribe(
56-
file=open(audio_test_file, "rb"),
57-
model=model_name,
58-
deployment_id=deployment_id
59-
)
60-
61-
print(result)
62-
```
39+
```python
40+
import openai
41+
import time
42+
import os
43+
44+
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
45+
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT") # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
46+
openai.api_type = "azure"
47+
openai.api_version = "2024-02-01"
48+
49+
model_name = "whisper"
50+
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
51+
audio_language="en"
52+
53+
audio_test_file = "./wikipediaOcelot.wav"
54+
55+
result = openai.Audio.transcribe(
56+
file=open(audio_test_file, "rb"),
57+
model=model_name,
58+
deployment_id=deployment_id
59+
)
60+
61+
print(result)
62+
```
6363

6464
Run the application with the python command on your quickstart file:
6565

articles/ai-services/openai/whisper-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: nitinme
66
ms.service: azure-ai-openai
77
ms.custom: devx-track-python
88
ms.topic: quickstart
9-
ms.date: 2/1/2024
9+
ms.date: 3/19/2024
1010
ms.reviewer: v-baolianzou
1111
ms.author: eur
1212
author: eric-urban

0 commit comments

Comments
 (0)