Update app.py
Browse files
app.py
CHANGED
@@ -39,22 +39,17 @@ def iwwersetz(source_text, model, direc):
|
|
39 |
translator = pipeline("translation", model=model_checkpoint_nllb)
|
40 |
if direc == "en -> lb":
|
41 |
translation = translator(source_text, src_lang="eng_Latn", tgt_lang="ltz_Latn")
|
42 |
-
# translation = source_text
|
43 |
else:
|
44 |
-
translation = translator(source_text, src_lang="ltz_Latn", tgt_lang="eng_Latn")
|
45 |
-
# translation = source_text
|
46 |
elif model == "MarianNMT":
|
47 |
if direc == "en -> lb":
|
48 |
translator = pipeline("translation", model=model_checkpoint_marian_en)
|
49 |
-
# translation = source_text
|
50 |
translation = translator(source_text)
|
51 |
else:
|
52 |
-
translator = pipeline("translation", model=model_checkpoint_marian_lb)
|
53 |
-
# translation = source_text
|
54 |
translation = translator(source_text)
|
55 |
elif model == "T5-mt5":
|
56 |
-
translator = pipeline("translation", model=model_checkpoint_t5_mt5)
|
57 |
-
# translation = source_text
|
58 |
translation = translator(source_text)
|
59 |
else:
|
60 |
translation = "Please select a Translation Model !"
|
|
|
39 |
translator = pipeline("translation", model=model_checkpoint_nllb)
|
40 |
if direc == "en -> lb":
|
41 |
translation = translator(source_text, src_lang="eng_Latn", tgt_lang="ltz_Latn")
|
|
|
42 |
else:
|
43 |
+
translation = translator(source_text, src_lang="ltz_Latn", tgt_lang="eng_Latn")
|
|
|
44 |
elif model == "MarianNMT":
|
45 |
if direc == "en -> lb":
|
46 |
translator = pipeline("translation", model=model_checkpoint_marian_en)
|
|
|
47 |
translation = translator(source_text)
|
48 |
else:
|
49 |
+
translator = pipeline("translation", model=model_checkpoint_marian_lb)
|
|
|
50 |
translation = translator(source_text)
|
51 |
elif model == "T5-mt5":
|
52 |
+
translator = pipeline("translation", model=model_checkpoint_t5_mt5)
|
|
|
53 |
translation = translator(source_text)
|
54 |
else:
|
55 |
translation = "Please select a Translation Model !"
|