Update modules/whisper/whisper_base.py
Browse files
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 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 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))
|