File size: 509 Bytes
6ba7703 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import time
import gradio as gr
def test(x, request: gr.Request, progress=gr.Progress()):
progress(0, desc="Test", unit = "Files")
print("request", request)
a = "abcdefghijklmnopqrstuv"
for letter in progress.tqdm(a, desc = "TEST", unit = "Files"):
time.sleep(0.1)
return gr.Textbox(a)
with gr.Blocks() as demo:
t = gr.Textbox()
b = gr.Button()
f = gr.File()
b.click(test, t, t)
t.submit(test, t, t)
f.upload(test, t, t)
demo.launch() |