Untitled

mail@pastecode.io avatar
unknown
plain_text
12 days ago
511 B
1
Indexable
Never
import os
from openai import AzureOpenAI

client = AzureOpenAI(
    api_key=os.getenv("AZURE_OPENAI_API_KEY"),  
    api_version="2024-02-01",
    azure_endpoint=os.getenv("AZURE_OPENAI_ENDPOINT")
)

deployment_id = "YOUR-DEPLOYMENT-NAME-HERE"  # This will correspond to the custom name you chose for your deployment when you deployed a model.
audio_test_file = "./wikipediaOcelot.wav"

result = client.audio.transcriptions.create(
    file=open(audio_test_file, "rb"),
    model=deployment_id
)

print(result)
Leave a Comment