Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
return result[0]["generated_text"]
|
| 9 |
|
| 10 |
-
|
| 11 |
-
["Zoe Kwan is a 20-year old singer and songwriter who has taken Hong Kong’s music scene by storm."],
|
| 12 |
-
["Zoe only recently began writing songs."],
|
| 13 |
-
]
|
| 14 |
-
|
| 15 |
-
demo = gr.Interface(fn=generate, inputs=gr.inputs.Textbox(lines=5, label="Input Text"), outputs=gr.outputs.Textbox(label="Generated Text"),
|
| 16 |
-
title="Text Generator Distil GPT2 Finetuned on HKDSE English Language Paper 4", examples=examples)
|
| 17 |
-
|
| 18 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from gradio.mix import Series
|
| 3 |
|
| 4 |
+
title = "Chinese Text Generator and Translator"
|
| 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/ckiplab/gpt2-base-chinese")
|
|
|
|
| 9 |
|
| 10 |
+
gr.Series(model1, translator, inputs=gr.Textbox(lines=5, label="Input Text"), title=title, description=description).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|