Update modules/translation/translation_base.py
Browse files
modules/translation/translation_base.py
CHANGED
|
@@ -136,8 +136,7 @@ class TranslationBase(ABC):
|
|
| 136 |
finally:
|
| 137 |
self.release_cuda_memory()
|
| 138 |
|
| 139 |
-
def translate_text(
|
| 140 |
-
input_list_dict: list,
|
| 141 |
model_size: str,
|
| 142 |
src_lang: str,
|
| 143 |
tgt_lang: str,
|
|
@@ -173,7 +172,7 @@ class TranslationBase(ABC):
|
|
| 173 |
|
| 174 |
total_progress = len(input_list_dict)
|
| 175 |
for index, dic in enumerate(input_list_dict):
|
| 176 |
-
progress(index / total_progress, desc="Translating
|
| 177 |
translated_text = self.translate(dic["text"], max_length=max_length)
|
| 178 |
dic["text"] = translated_text
|
| 179 |
|
|
|
|
| 136 |
finally:
|
| 137 |
self.release_cuda_memory()
|
| 138 |
|
| 139 |
+
def translate_text(input_list_dict: list,
|
|
|
|
| 140 |
model_size: str,
|
| 141 |
src_lang: str,
|
| 142 |
tgt_lang: str,
|
|
|
|
| 172 |
|
| 173 |
total_progress = len(input_list_dict)
|
| 174 |
for index, dic in enumerate(input_list_dict):
|
| 175 |
+
progress(index / total_progress, desc="Translating..")
|
| 176 |
translated_text = self.translate(dic["text"], max_length=max_length)
|
| 177 |
dic["text"] = translated_text
|
| 178 |
|