Update modules/whisper/whisper_base.py
Browse files
modules/whisper/whisper_base.py
CHANGED
|
@@ -20,6 +20,7 @@ from modules.whisper.whisper_parameter import *
|
|
| 20 |
from modules.diarize.diarizer import Diarizer
|
| 21 |
from modules.vad.silero_vad import SileroVAD
|
| 22 |
from modules.translation.nllb_inference import NLLBInference
|
|
|
|
| 23 |
|
| 24 |
class WhisperBase(ABC):
|
| 25 |
def __init__(self,
|
|
@@ -271,7 +272,7 @@ class WhisperBase(ABC):
|
|
| 271 |
# Translate the transcribed segments
|
| 272 |
if translate_output:
|
| 273 |
self.nllb_inf = NLLBInference()
|
| 274 |
-
if file_language in self.
|
| 275 |
transcribed_segments = self.nllb_inf.translate_text(
|
| 276 |
input_list_dict=transcribed_segments,
|
| 277 |
model_size=translate_model,
|
|
|
|
| 20 |
from modules.diarize.diarizer import Diarizer
|
| 21 |
from modules.vad.silero_vad import SileroVAD
|
| 22 |
from modules.translation.nllb_inference import NLLBInference
|
| 23 |
+
from modules.translation.nllb_inference import NLLB_AVAILABLE_LANGS
|
| 24 |
|
| 25 |
class WhisperBase(ABC):
|
| 26 |
def __init__(self,
|
|
|
|
| 272 |
# Translate the transcribed segments
|
| 273 |
if translate_output:
|
| 274 |
self.nllb_inf = NLLBInference()
|
| 275 |
+
if file_language in self.NLLB_AVAILABLE_LANGS.keys():
|
| 276 |
transcribed_segments = self.nllb_inf.translate_text(
|
| 277 |
input_list_dict=transcribed_segments,
|
| 278 |
model_size=translate_model,
|