Spaces:
Running
Running
Daniel Amendoeira
commited on
Update tools.py
Browse files
tools.py
CHANGED
@@ -70,7 +70,7 @@ def transcribe_audio(audio_input: str) -> str:
|
|
70 |
|
71 |
# Transcribing audio using OpenAI Whisper
|
72 |
client = OpenAI()
|
73 |
-
with open(file_path, "rb") as audio_file:
|
74 |
transcription = client.audio.transcriptions.create(
|
75 |
model="whisper-1",
|
76 |
file=audio_file
|
|
|
70 |
|
71 |
# Transcribing audio using OpenAI Whisper
|
72 |
client = OpenAI()
|
73 |
+
with open(file_path, "rb") as audio_file: # opens the audio file from disk in binary mode (rb); the "with" block ensures the file is automatically closed afterward
|
74 |
transcription = client.audio.transcriptions.create(
|
75 |
model="whisper-1",
|
76 |
file=audio_file
|