camparchimedes commited on
Commit
2389999
·
verified ·
1 Parent(s): 9bee7bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -68,8 +68,8 @@ 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 to tensor
72
- waveform, sample_rate = torchaudio.load(audio_file)
73
 
74
  if waveform.ndim > 1:
75
  waveform = waveform[0, :]
 
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:
75
  waveform = waveform[0, :]