LAP-DEV commited on
Commit
acf9c3b
·
verified ·
1 Parent(s): 4bbbd41

Update modules/whisper/whisper_base.py

Browse files
Files changed (1) hide show
  1. modules/whisper/whisper_base.py +8 -8
modules/whisper/whisper_base.py CHANGED
@@ -268,14 +268,14 @@ class WhisperBase(ABC):
268
  #files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext)}
269
 
270
  # Translate the trandscribed segments
271
- self.nllb_inf = NLLBInference()
272
- test = self.nllb_inf.translate_text(
273
- input_list_dict=transcribed_segments,
274
- model_size="facebook/nllb-200-distilled-600M",
275
- src_lang=file_language,
276
- tgt_lang="Dutch"
277
- )
278
- print(test)
279
 
280
  ## Get preview as txt
281
  file_name, file_ext = os.path.splitext(os.path.basename(file))
 
268
  #files_info[file_name] = {"subtitle": subtitle, "time_for_task": time_for_task, "path": file_path, "lang": file_language, "lang_prob": file_lang_probs, "input_source_file": (file_name+file_ext)}
269
 
270
  # Translate the trandscribed segments
271
+ if translate_output:
272
+ self.nllb_inf = NLLBInference()
273
+ transcribed_segments = self.nllb_inf.translate_text(
274
+ input_list_dict=transcribed_segments,
275
+ model_size=translate_model,
276
+ src_lang=file_language,
277
+ tgt_lang=target_lang
278
+ )
279
 
280
  ## Get preview as txt
281
  file_name, file_ext = os.path.splitext(os.path.basename(file))