Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,11 @@ def translate(text):
|
|
| 12 |
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 13 |
return translated_text
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
iface = gr.Interface(
|
| 16 |
-
fn=
|
| 17 |
inputs=gr.Textbox(lines=5, label="输入文本 (支持中英互译)"),
|
| 18 |
outputs=gr.Textbox(label="翻译结果"),
|
| 19 |
title="WiNGPT-Babel 翻译 Demo",
|
|
|
|
| 12 |
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 13 |
return translated_text
|
| 14 |
|
| 15 |
+
def predict(text):
|
| 16 |
+
return translate(text)
|
| 17 |
+
|
| 18 |
iface = gr.Interface(
|
| 19 |
+
fn=predict,
|
| 20 |
inputs=gr.Textbox(lines=5, label="输入文本 (支持中英互译)"),
|
| 21 |
outputs=gr.Textbox(label="翻译结果"),
|
| 22 |
title="WiNGPT-Babel 翻译 Demo",
|