Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,9 +14,23 @@ def predict_zh(sketch):
|
|
| 14 |
return generated_text
|
| 15 |
|
| 16 |
|
| 17 |
-
gr.
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
return generated_text
|
| 15 |
|
| 16 |
|
| 17 |
+
with gr.Blocks() as demo:
|
| 18 |
+
gr.Markdown(
|
| 19 |
+
"""
|
| 20 |
+
💡GENIUS – generating text using sketches! [Visit our github repo](https://github.com/beyondguo/genius)
|
| 21 |
+
The English version use `<mask>` as the mask token.
|
| 22 |
+
""")
|
| 23 |
+
|
| 24 |
+
with gr.Row():
|
| 25 |
+
with gr.Column():
|
| 26 |
+
model_input = gr.Textbox(lines=7, placeholder='Input your sketch', label='Input')
|
| 27 |
+
with gr.Row():
|
| 28 |
+
gen = gr.Button("Generate")
|
| 29 |
+
clr = gr.Button("Clear")
|
| 30 |
+
|
| 31 |
+
outputs = gr.Textbox(lines=7, label='Output')
|
| 32 |
+
|
| 33 |
+
gen.click(fn=predict_zh, inputs=[model_input], outputs=outputs)
|
| 34 |
+
clr.click(fn=lambda value: gr.update(value=""), inputs=clr, outputs=model_input)
|
| 35 |
+
|
| 36 |
+
demo.launch()
|