Spaces:
Runtime error
Runtime error
Commit
·
f3f0a16
1
Parent(s):
9e79a4c
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import time
|
3 |
+
def update(name):
|
4 |
+
time.sleep(25)
|
5 |
+
return f"Welcome to Gradio, {name}!"
|
6 |
+
|
7 |
+
def test():
|
8 |
+
return("test")
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("Start typing below and then click **Run** to see the output.")
|
12 |
+
with gr.Row():
|
13 |
+
inp = gr.Image()
|
14 |
+
out = gr.Textbox()
|
15 |
+
out_test = gr.Textbox()
|
16 |
+
btn = gr.Button("Run")
|
17 |
+
inp.upload(fn=test, outputs=out_test)
|
18 |
+
btn.click(fn=update, inputs=inp, outputs=out)
|
19 |
+
|
20 |
+
demo.launch()
|