Spaces:
Sleeping
Sleeping
cointegrated
commited on
Commit
•
bc7c963
1
Parent(s):
f515ff9
fix lang args
Browse files
app.py
CHANGED
@@ -61,8 +61,8 @@ def translate(
|
|
61 |
|
62 |
|
63 |
def translate_wrapper(text, src, trg, correct=None):
|
64 |
-
|
65 |
-
|
66 |
if src == trg:
|
67 |
return 'Please choose two different languages'
|
68 |
print(text, src, trg)
|
@@ -70,8 +70,8 @@ def translate_wrapper(text, src, trg, correct=None):
|
|
70 |
text=text,
|
71 |
model=model,
|
72 |
tokenizer=tokenizer,
|
73 |
-
|
74 |
-
|
75 |
)
|
76 |
return result
|
77 |
|
|
|
61 |
|
62 |
|
63 |
def translate_wrapper(text, src, trg, correct=None):
|
64 |
+
src_lang = lang_to_code.get(src)
|
65 |
+
tgt_lang = lang_to_code.get(trg)
|
66 |
if src == trg:
|
67 |
return 'Please choose two different languages'
|
68 |
print(text, src, trg)
|
|
|
70 |
text=text,
|
71 |
model=model,
|
72 |
tokenizer=tokenizer,
|
73 |
+
src_lang=src_lang,
|
74 |
+
tgt_lang=tgt_lang,
|
75 |
)
|
76 |
return result
|
77 |
|