Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -621,8 +621,11 @@ def transcribe(audio_file):
|
|
621 |
with open(audio_file, "rb") as f:
|
622 |
audio_data = f.read()
|
623 |
|
624 |
-
|
625 |
-
|
|
|
|
|
|
|
626 |
|
627 |
def vote(data: gr.LikeData):
|
628 |
if data.liked:
|
|
|
621 |
with open(audio_file, "rb") as f:
|
622 |
audio_data = f.read()
|
623 |
|
624 |
+
# Use the appropriate method of the InferenceClient for audio transcription
|
625 |
+
response = whisper_api.audio_to_text(audio_data)
|
626 |
+
|
627 |
+
# The response structure might vary, so adjust this line accordingly
|
628 |
+
return response["text"] if "text" in response else str(response)
|
629 |
|
630 |
def vote(data: gr.LikeData):
|
631 |
if data.liked:
|