Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -69,9 +69,8 @@ def infer(sample_audio_path, target_text, progress=gr.Progress()):
|
|
69 |
# If already mono, just use the original waveform
|
70 |
waveform_mono = waveform
|
71 |
prompt_wav = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000)(waveform_mono)
|
72 |
-
prompt_text = whisper_turbo_pipe(prompt_wav[0].
|
73 |
progress(0.5, 'Transcribed! Generating speech...')
|
74 |
-
|
75 |
if len(target_text) == 0:
|
76 |
return None
|
77 |
elif len(target_text) > 300:
|
|
|
69 |
# If already mono, just use the original waveform
|
70 |
waveform_mono = waveform
|
71 |
prompt_wav = torchaudio.transforms.Resample(orig_freq=sample_rate, new_freq=16000)(waveform_mono)
|
72 |
+
prompt_text = whisper_turbo_pipe(prompt_wav[0].numpy())['text'].strip()
|
73 |
progress(0.5, 'Transcribed! Generating speech...')
|
|
|
74 |
if len(target_text) == 0:
|
75 |
return None
|
76 |
elif len(target_text) > 300:
|