mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
17 lines
317 B
Python
17 lines
317 B
Python
|
import gradio as gr
|
||
|
import asyncio
|
||
|
|
||
|
|
||
|
async def say_hello(name):
|
||
|
await asyncio.sleep(5)
|
||
|
return f"Hello {name}!"
|
||
|
|
||
|
|
||
|
with gr.Blocks() as demo:
|
||
|
inp = gr.Textbox()
|
||
|
outp = gr.Textbox()
|
||
|
button = gr.Button()
|
||
|
button.click(say_hello, inp, outp)
|
||
|
|
||
|
demo.configure_queue(concurrency_count=5).launch(enable_queue=True)
|