Shreyas094 commited on
Commit
e228810
·
verified ·
1 Parent(s): 5718148

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- response = whisper_api(audio_data)
625
- return response["text"]
 
 
 
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: