[update]add sent_tokenize
Browse files
main.py
CHANGED
@@ -23,11 +23,11 @@ def main():
|
|
23 |
}
|
24 |
}
|
25 |
|
26 |
-
def
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
model_group = model_dict.get(model_name)
|
32 |
if model_group is None:
|
33 |
for k in list(model_dict.keys()):
|
@@ -92,7 +92,7 @@ It was introduced in this [paper](https://arxiv.org/abs/2010.11125) and first re
|
|
92 |
output = gr.Textbox(lines=4, label="Output Text")
|
93 |
|
94 |
demo = gr.Interface(
|
95 |
-
fn=
|
96 |
inputs=inputs,
|
97 |
outputs=output,
|
98 |
examples=examples,
|
|
|
23 |
}
|
24 |
}
|
25 |
|
26 |
+
def multilingual_translation(src_text: str,
|
27 |
+
src_lang: str,
|
28 |
+
tgt_lang: str,
|
29 |
+
model_name: str,
|
30 |
+
):
|
31 |
model_group = model_dict.get(model_name)
|
32 |
if model_group is None:
|
33 |
for k in list(model_dict.keys()):
|
|
|
92 |
output = gr.Textbox(lines=4, label="Output Text")
|
93 |
|
94 |
demo = gr.Interface(
|
95 |
+
fn=multilingual_translation,
|
96 |
inputs=inputs,
|
97 |
outputs=output,
|
98 |
examples=examples,
|