Skip to content

Commit b816bc6

Browse files
committed
update
1 parent 8323e95 commit b816bc6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ pip install openai==0.28.1
3939
# [OpenAI Python 1.x](#tab/python-new)
4040

4141
```python
42-
import os
43-
from openai import AzureOpenAI
42+
import os
43+
from openai import AzureOpenAI
44+
45+
client = AzureOpenAI(
46+
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
47+
api_version="2024-02-01",
48+
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
49+
)
4450

45-
client = AzureOpenAI(
46-
api_key=os.getenv("AZURE_OPENAI_API_KEY"),
47-
api_version="2024-02-01",
48-
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
49-
)
50-
51-
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
52-
audio_test_file = "./wikipediaOcelot.wav"
53-
54-
result = client.audio.transcriptions.create(
55-
file=open(audio_test_file, "rb"),
56-
model=deployment_id
57-
)
58-
59-
print(result)
51+
deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
52+
audio_test_file = "./wikipediaOcelot.wav"
53+
54+
result = client.audio.transcriptions.create(
55+
file=open(audio_test_file, "rb"),
56+
model=deployment_id
57+
)
58+
59+
print(result)
6060
```
6161

6262
# [OpenAI Python 0.28.1](#tab/python)

0 commit comments

Comments
 (0)