Spaces:
Sleeping
Sleeping
import gradio as gr | |
import time | |
def identity_with_sleep(x): | |
time.sleep(0.5) | |
return x | |
with gr.Blocks() as demo: | |
with gr.Row(): | |
with gr.Column(): | |
input_img = gr.Image() | |
output_img = gr.Image() | |
submit_img = gr.Button() | |
submit_img.click(identity_with_sleep, input_img, output_img, api_name="img") | |
with gr.Column(): | |
input_txt = gr.Text() | |
output_text = gr.Text() | |
submit_text = gr.Button() | |
submit_text.click(identity_with_sleep, input_txt, output_text, api_name="text") | |
with gr.Column(): | |
input_audio = gr.Audio() | |
output_audio = gr.Audio() | |
submit_audio = gr.Button() | |
submit_audio.click(identity_with_sleep, input_audio, output_audio, api_name="audio") | |
with gr.Column(): | |
input_video = gr.Video() | |
output_video = gr.Video() | |
submit_video = gr.Button() | |
submit_video.click(identity_with_sleep, input_video, output_video, api_name="video") | |
demo.queue(max_size=50, concurrency_count=20).launch() | |