camparchimedes commited on
Commit
cd7ab60
·
verified ·
1 Parent(s): 2f95ea1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -68,7 +68,9 @@ pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large"
68
 
69
  @spaces.GPU()
70
  def transcribe_audio(audio_file, batch_size=16, sample_rate =16000):
71
- audio_file = audio_tuple[0] # assumes first element of the tuple contains the file path;
 
 
72
  waveform, sample_rate = torchaudio.load(audio_file) # to avoid TypeError here
73
 
74
  if waveform.ndim > 1:
 
68
 
69
  @spaces.GPU()
70
  def transcribe_audio(audio_file, batch_size=16, sample_rate =16000):
71
+ if isinstance(audio_file, tuple):
72
+ audio_file = audio_file[0] # assumes first element contains the file path;
73
+
74
  waveform, sample_rate = torchaudio.load(audio_file) # to avoid TypeError here
75
 
76
  if waveform.ndim > 1: