Spaces:
Runtime error
Runtime error
revert to original
Browse files
app.py
CHANGED
|
@@ -3,14 +3,14 @@ from gradio.mix import Parallel, Series
|
|
| 3 |
|
| 4 |
from transformers import pipeline
|
| 5 |
|
| 6 |
-
translater = pipeline("translation", model="
|
| 7 |
|
| 8 |
|
| 9 |
def translate(inp, direction):
|
| 10 |
-
if direction == '
|
| 11 |
-
text = "si: " + inp
|
| 12 |
-
else:
|
| 13 |
text = "en: " + inp
|
|
|
|
|
|
|
| 14 |
|
| 15 |
res = translater(
|
| 16 |
text,
|
|
@@ -22,7 +22,7 @@ def translate(inp, direction):
|
|
| 22 |
description = """
|
| 23 |
<p>
|
| 24 |
<center>
|
| 25 |
-
Multi-domain Translation Between
|
| 26 |
</center>
|
| 27 |
</p>
|
| 28 |
"""
|
|
|
|
| 3 |
|
| 4 |
from transformers import pipeline
|
| 5 |
|
| 6 |
+
translater = pipeline("translation", model="VietAI/envit5-translation")
|
| 7 |
|
| 8 |
|
| 9 |
def translate(inp, direction):
|
| 10 |
+
if direction == 'en->vi':
|
|
|
|
|
|
|
| 11 |
text = "en: " + inp
|
| 12 |
+
else:
|
| 13 |
+
text = "vi: " + inp
|
| 14 |
|
| 15 |
res = translater(
|
| 16 |
text,
|
|
|
|
| 22 |
description = """
|
| 23 |
<p>
|
| 24 |
<center>
|
| 25 |
+
Multi-domain Translation Between English and Vietnamese
|
| 26 |
</center>
|
| 27 |
</p>
|
| 28 |
"""
|