OmniParser icon indicating copy to clipboard operation
OmniParser copied to clipboard

report a problem about running gradio_demo.py slowly

Open JerryFanFan opened this issue 11 months ago • 0 comments

When I executed gradio_demo.py, I noticed that it took an exceptionally long time without yielding any results. Upon inspecting the code, I found that there seems to be an issue with the execution of the submit_button_component.click in relation to the Gradio component.

When using queue=True(default), Gradio handles requests in a new process, which prevents the CUDA context from being shared between processes, causing the GPU model inference to hang. Setting queue=False allows requests to be processed directly in the main process, avoiding this issue.

submit_button_component.click(
        fn=process,
       ......
        queue=False 
    )

JerryFanFan avatar Feb 23 '25 14:02 JerryFanFan