Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,9 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
|
5 |
from flores200_codes import flores_codes
|
6 |
|
7 |
def load_models():
|
8 |
-
model_name_dict = {'nllb-distilled-
|
|
|
|
|
9 |
model_dict = {}
|
10 |
for call_name, real_name in model_name_dict.items():
|
11 |
print(f'\tLoading model: {call_name}')
|
@@ -20,7 +22,7 @@ model_dict = load_models()
|
|
20 |
|
21 |
def translate_text(source_lang, target_lang, input_text):
|
22 |
if len(model_dict) == 2:
|
23 |
-
model_name = 'nllb-distilled-
|
24 |
start_time = time.time()
|
25 |
source = flores_codes.get(source_lang)
|
26 |
target = flores_codes.get(target_lang)
|
|
|
5 |
from flores200_codes import flores_codes
|
6 |
|
7 |
def load_models():
|
8 |
+
model_name_dict = {'nllb-distilled-1.3B': 'facebook/nllb-200-distilled-1.3B',
|
9 |
+
#'nllb-distilled-600M': 'facebook/nllb-200-distilled-600M'
|
10 |
+
}
|
11 |
model_dict = {}
|
12 |
for call_name, real_name in model_name_dict.items():
|
13 |
print(f'\tLoading model: {call_name}')
|
|
|
22 |
|
23 |
def translate_text(source_lang, target_lang, input_text):
|
24 |
if len(model_dict) == 2:
|
25 |
+
model_name = 'nllb-distilled-1.3B'
|
26 |
start_time = time.time()
|
27 |
source = flores_codes.get(source_lang)
|
28 |
target = flores_codes.get(target_lang)
|