change m2m target language setup
Browse files
app.py
CHANGED
@@ -179,10 +179,10 @@ def mbart_trans(article, target_language):
|
|
179 |
def m2m_trans(article, target_language):
|
180 |
result_lang = detect_lang(article)
|
181 |
if target_language == "English":
|
182 |
-
|
183 |
elif target_language == "Chinese":
|
184 |
-
|
185 |
-
if result_lang !=
|
186 |
if target_language == "English":
|
187 |
return m2m_model.translate(article, target_lang="en")
|
188 |
elif target_language == "Chinese":
|
|
|
179 |
def m2m_trans(article, target_language):
|
180 |
result_lang = detect_lang(article)
|
181 |
if target_language == "English":
|
182 |
+
target_lang = "en"
|
183 |
elif target_language == "Chinese":
|
184 |
+
target_lang = "zh"
|
185 |
+
if result_lang != target_lang:
|
186 |
if target_language == "English":
|
187 |
return m2m_model.translate(article, target_lang="en")
|
188 |
elif target_language == "Chinese":
|