microsoft / microsoft/OmniParser
report a problem about running gradio_demo.py slowly
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 25.4k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
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
)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in gradio_demo.py and inspect the submit_button_component.click configuration, especially its queue setting. Reproduce the slow or hanging execution, apply the issue's proposed request-processing change, and verify that the demo returns results without hanging during GPU model inference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100