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() |