Update modules/whisper/whisper_base.py
Browse files
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
|
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 (
|
283 |
else:
|
284 |
-
print (
|
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))
|