MulaiMulai sekarang secara gratis

Translating Portuguese

OpenAI's audio models can not only transcribe audio into its native language, but also support translation capabilities for creating English transcriptions.

In this exercise, you'll return to the Portuguese audio, but this time, you'll translate it into English!

Latihan ini adalah bagian dari kursus

Multi-Modal Systems with the OpenAI API

Lihat Kursus

Petunjuk latihan

  • Open the audio.m4a file.
  • Create a translation request to the Audio endpoint.
  • Extract and print the translated text from the response.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

client = OpenAI(api_key="")

# Open the audio.m4a file
audio_file = ____(____, "rb")

# Create a translation from the audio file
response = client.audio.____.____(model="whisper-1", file=____)

# Extract and print the translated text
print(response.____)
Edit dan Jalankan Kode