LAP-DEV commited on
Commit
08580cf
·
verified ·
1 Parent(s): edc53f0

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +3 -3
modules/whisper/whisper_base.py CHANGED
@@ -271,7 +271,7 @@ class WhisperBase(ABC):
271
  # Translate the transcribed segments
272
  if translate_output:
273
  self.nllb_inf = NLLBInference()
274
- if src_lang in self.nllb_inf.NLLB_AVAILABLE_LANGS.keys():
275
  transcribed_segments = self.nllb_inf.translate_text(
276
  input_list_dict=transcribed_segments,
277
  model_size=translate_model,
@@ -279,9 +279,9 @@ class WhisperBase(ABC):
279
  tgt_lang=target_lang,
280
  speaker_diarization=params.is_diarize
281
  )
282
- print (src_lang + " found")
283
  else:
284
- print (src_lang + " not supported")
285
 
286
  ## Get preview as txt
287
  file_name, file_ext = os.path.splitext(os.path.basename(file))
 
271
  # Translate the transcribed segments
272
  if translate_output:
273
  self.nllb_inf = NLLBInference()
274
+ if file_language in self.nllb_inf.NLLB_AVAILABLE_LANGS.keys():
275
  transcribed_segments = self.nllb_inf.translate_text(
276
  input_list_dict=transcribed_segments,
277
  model_size=translate_model,
 
279
  tgt_lang=target_lang,
280
  speaker_diarization=params.is_diarize
281
  )
282
+ print (file_language + " found")
283
  else:
284
+ print (file_language + " not supported")
285
 
286
  ## Get preview as txt
287
  file_name, file_ext = os.path.splitext(os.path.basename(file))