Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,15 @@ def iwwersetz(source_text, model, direc):
|
|
44 |
# translation = translator("lb", "en", source_text)
|
45 |
translation = source_text
|
46 |
elif model == "MarianNMT":
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
elif model == "T5-mt5":
|
|
|
|
|
49 |
translation = source_text
|
50 |
else:
|
51 |
translation = "Please select a Translation Model !"
|
|
|
44 |
# translation = translator("lb", "en", source_text)
|
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 |
+
else:
|
51 |
+
translator = pipeline("translation", model=model_checkpoint_marian_lb)
|
52 |
+
translation = source_text
|
53 |
elif model == "T5-mt5":
|
54 |
+
translator = pipeline("translation", model=model_checkpoint_t5-mt5)
|
55 |
+
translation = source_text
|
56 |
translation = source_text
|
57 |
else:
|
58 |
translation = "Please select a Translation Model !"
|