Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
from gradio.mix import Series
|
3 |
|
4 |
-
title = "Chinese Language Translator and Text Generator"
|
5 |
description = "Input Chinese language text, submit and the machine will generate additional English language text."
|
6 |
|
7 |
translator = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-zh-en")
|
8 |
model1 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
9 |
model2 = gr.Interface.load("huggingface/ckiplab/gpt2-base-chinese")
|
10 |
|
11 |
-
tg_demo = gr.Series(translator, model1, inputs=gr.Textbox(lines=5, label="Input Text"), outputs="text")
|
12 |
-
gt_demo = gr.Series(model2, translator, inputs=gr.Textbox(lines=5, label="Input Text"), outputs="text")
|
13 |
|
14 |
-
demo = gr.TabbedInterface([tg_demo, gt_demo], ["Chinese Translator to English Generator", "Chinese Generator to English Translator"]
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
from gradio.mix import Series
|
3 |
|
|
|
4 |
description = "Input Chinese language text, submit and the machine will generate additional English language text."
|
5 |
|
6 |
translator = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-zh-en")
|
7 |
model1 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
8 |
model2 = gr.Interface.load("huggingface/ckiplab/gpt2-base-chinese")
|
9 |
|
10 |
+
tg_demo = gr.Series(translator, model1, inputs=gr.Textbox(lines=5, label="Input Text"), outputs="text", description=description)
|
11 |
+
gt_demo = gr.Series(model2, translator, inputs=gr.Textbox(lines=5, label="Input Text"), outputs="text", description=description)
|
12 |
|
13 |
+
demo = gr.TabbedInterface([tg_demo, gt_demo], ["Chinese Translator to English Generator", "Chinese Generator to English Translator"])
|
14 |
|
15 |
if __name__ == "__main__":
|
16 |
demo.launch()
|