camparchimedes commited on
Commit
dd49603
·
verified ·
1 Parent(s): 4d9a914

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -70,11 +70,11 @@ def convert_to_wav(filepath):
70
  pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'no'})
71
 
72
  @spaces.GPU()
73
- def transcribe_audio(audio_file, batch_size=16):
74
 
75
  with tempfile.NamedTemporaryFile(suffix=".wav") as temp_audio_file:
76
  # Copy the contents of the uploaded audio file to the temporary file
77
- temp_audio_file.write(open(audio_file, "rb").read())
78
  temp_audio_file.flush()
79
  # Load the audio file using torchaudio
80
  waveform, sample_rate = torchaudio.load(temp_audio_file.name)
 
70
  pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large", chunk_length_s=30, generate_kwargs={'task': 'transcribe', 'language': 'no'})
71
 
72
  @spaces.GPU()
73
+ def transcribe_audio(audio, batch_size=16):
74
 
75
  with tempfile.NamedTemporaryFile(suffix=".wav") as temp_audio_file:
76
  # Copy the contents of the uploaded audio file to the temporary file
77
+ temp_audio_file.write(open(audio, "rb").read())
78
  temp_audio_file.flush()
79
  # Load the audio file using torchaudio
80
  waveform, sample_rate = torchaudio.load(temp_audio_file.name)