Shreyas094 commited on
Commit
abe40b3
·
verified ·
1 Parent(s): 7315960

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -14
app.py CHANGED
@@ -629,22 +629,12 @@ def transcribe(audio_file):
629
 
630
  print(f"Read {len(audio_data)} bytes from audio file")
631
 
632
- # Prepare the inputs
633
- inputs = {
634
- "audio": audio_data
635
- }
636
-
637
- # Prepare the parameters (you can adjust these as needed)
638
- parameters = {
639
- "return_timestamps": False,
640
- "language": "en" # or "auto" for automatic language detection
641
- }
642
-
643
  print("Calling automatic_speech_recognition")
644
 
645
  response = whisper_api.automatic_speech_recognition(
646
- inputs=inputs,
647
- parameters=parameters
 
648
  )
649
 
650
  print(f"Received response: {response}")
@@ -654,7 +644,6 @@ def transcribe(audio_file):
654
  print(f"Error in transcription: {str(e)}")
655
  return f"Error in transcription: {str(e)}"
656
 
657
-
658
  def vote(data: gr.LikeData):
659
  if data.liked:
660
  print(f"You upvoted this response: {data.value}")
 
629
 
630
  print(f"Read {len(audio_data)} bytes from audio file")
631
 
 
 
 
 
 
 
 
 
 
 
 
632
  print("Calling automatic_speech_recognition")
633
 
634
  response = whisper_api.automatic_speech_recognition(
635
+ audio_data,
636
+ return_timestamps=False,
637
+ language="en" # or "auto" for automatic language detection
638
  )
639
 
640
  print(f"Received response: {response}")
 
644
  print(f"Error in transcription: {str(e)}")
645
  return f"Error in transcription: {str(e)}"
646
 
 
647
  def vote(data: gr.LikeData):
648
  if data.liked:
649
  print(f"You upvoted this response: {data.value}")