Spaces:
Running
Running
jhj0517
commited on
Commit
·
5c966f8
1
Parent(s):
17e1e38
Refactor default parameters for initialization
Browse files
modules/translation/deepl_api.py
CHANGED
@@ -83,7 +83,7 @@ DEEPL_AVAILABLE_SOURCE_LANGS = {
|
|
83 |
|
84 |
class DeepLAPI:
|
85 |
def __init__(self,
|
86 |
-
output_dir: str
|
87 |
):
|
88 |
self.api_interval = 1
|
89 |
self.max_text_batch_size = 50
|
|
|
83 |
|
84 |
class DeepLAPI:
|
85 |
def __init__(self,
|
86 |
+
output_dir: str = os.path.join("outputs", "translations")
|
87 |
):
|
88 |
self.api_interval = 1
|
89 |
self.max_text_batch_size = 50
|
modules/translation/nllb_inference.py
CHANGED
@@ -7,8 +7,8 @@ from modules.translation.translation_base import TranslationBase
|
|
7 |
|
8 |
class NLLBInference(TranslationBase):
|
9 |
def __init__(self,
|
10 |
-
model_dir: str,
|
11 |
-
output_dir: str
|
12 |
):
|
13 |
super().__init__(
|
14 |
model_dir=model_dir,
|
|
|
7 |
|
8 |
class NLLBInference(TranslationBase):
|
9 |
def __init__(self,
|
10 |
+
model_dir: str = os.path.join("models", "NLLB"),
|
11 |
+
output_dir: str = os.path.join("outputs", "translations")
|
12 |
):
|
13 |
super().__init__(
|
14 |
model_dir=model_dir,
|
modules/translation/translation_base.py
CHANGED
@@ -11,8 +11,9 @@ from modules.utils.subtitle_manager import *
|
|
11 |
|
12 |
class TranslationBase(ABC):
|
13 |
def __init__(self,
|
14 |
-
model_dir: str,
|
15 |
-
output_dir: str)
|
|
|
16 |
super().__init__()
|
17 |
self.model = None
|
18 |
self.model_dir = model_dir
|
|
|
11 |
|
12 |
class TranslationBase(ABC):
|
13 |
def __init__(self,
|
14 |
+
model_dir: str = os.path.join("models", "NLLB"),
|
15 |
+
output_dir: str = os.path.join("outputs", "translations")
|
16 |
+
):
|
17 |
super().__init__()
|
18 |
self.model = None
|
19 |
self.model_dir = model_dir
|