File size: 485 Bytes
f3f0a16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import time
def update(name):
    time.sleep(25)
    return f"Welcome to Gradio, {name}!"

def test():
    return("test")

with gr.Blocks() as demo:
    gr.Markdown("Start typing below and then click **Run** to see the output.")
    with gr.Row():
        inp = gr.Image()
        out = gr.Textbox()
        out_test = gr.Textbox()
    btn = gr.Button("Run")
    inp.upload(fn=test, outputs=out_test)
    btn.click(fn=update, inputs=inp, outputs=out)

demo.launch()