mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-09 02:00:44 +08:00
f66c104fc2
* max-thread-tweaks 1. move creation of limiter to fastapi endpoint since run_coro_in_background works only in there 2. make max_threads compatible with queue concurrency count * max-thread-tweaks 1. add warning to run_coro_in_background
17 lines
273 B
Python
17 lines
273 B
Python
import gradio as gr
|
|
import time
|
|
|
|
|
|
def say_hello(name):
|
|
time.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.queue(concurrency_count=41).launch()
|