Hematej commited on
Commit
a4b2dd4
·
verified ·
1 Parent(s): 902f49d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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].cpu().numpy(), language="en")['text'].strip() # ✅ Force English transcription
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: