Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -260,7 +260,12 @@ class BasicAgent:
|
|
260 |
'''
|
261 |
def _transcribe_audio(self, audio_bytes: BytesIO) -> str:
|
262 |
#audio_file = BytesIO(audio_bytes)
|
263 |
-
transcription = self.client.audio.transcriptions.create(model="whisper-1", file=audio_bytes)
|
|
|
|
|
|
|
|
|
|
|
264 |
print_coso(f"usato _transcribe_audio: {transcription}")
|
265 |
return transcription.text.strip()
|
266 |
|
|
|
260 |
'''
|
261 |
def _transcribe_audio(self, audio_bytes: BytesIO) -> str:
|
262 |
#audio_file = BytesIO(audio_bytes)
|
263 |
+
#transcription = self.client.audio.transcriptions.create(model="whisper-1", file=audio_bytes)
|
264 |
+
transcription = Audio.transcribe(
|
265 |
+
file=audio_bytes,
|
266 |
+
model="whisper-1",
|
267 |
+
api_key=os.getenv(openai_api_key)
|
268 |
+
)
|
269 |
print_coso(f"usato _transcribe_audio: {transcription}")
|
270 |
return transcription.text.strip()
|
271 |
|