Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,11 +69,12 @@ pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large"
|
|
| 69 |
@spaces.GPU()
|
| 70 |
def transcribe_audio(audio_file, batch_size=16, sample_rate =16000):
|
| 71 |
# --audio file to tensor
|
| 72 |
-
|
| 73 |
-
samples =
|
| 74 |
if waveform.ndim > 1:
|
| 75 |
waveform = waveform[0, :]
|
| 76 |
-
waveform
|
|
|
|
| 77 |
|
| 78 |
start_time = time.time()
|
| 79 |
|
|
|
|
| 69 |
@spaces.GPU()
|
| 70 |
def transcribe_audio(audio_file, batch_size=16, sample_rate =16000):
|
| 71 |
# --audio file to tensor
|
| 72 |
+
|
| 73 |
+
waveform, samples = torchaudio.load(waveform, samples)
|
| 74 |
if waveform.ndim > 1:
|
| 75 |
waveform = waveform[0, :]
|
| 76 |
+
waveform = waveform.numpy(audio_file)
|
| 77 |
+
samples = samples.numpy(audio_file)
|
| 78 |
|
| 79 |
start_time = time.time()
|
| 80 |
|