huckiyang commited on
Commit
f95bbb9
·
1 Parent(s): d7c422e

Revert "[test] st_en"

Browse files

This reverts commit afe4a7c18a26e400cc3f8bdc0a648287771e36e6.

Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -155,8 +155,12 @@ def translate_to_english(audio_file, source_language):
155
  # Load and resample the audio file to 16kHz
156
  speech, _ = librosa.load(audio_file, sr=16000)
157
 
 
 
 
 
158
  # Set task to speech translation to English
159
- model.task_sym = "<st_en>"
160
 
161
  # Set source language
162
  if source_language != None:
 
155
  # Load and resample the audio file to 16kHz
156
  speech, _ = librosa.load(audio_file, sr=16000)
157
 
158
+ # Reset beam search state
159
+ model.beam_search.hyps = None
160
+ model.beam_search.pre_beam_score_key = None
161
+
162
  # Set task to speech translation to English
163
+ model.task_sym = "<st_eng>"
164
 
165
  # Set source language
166
  if source_language != None: