Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradio-cli accept SIGINT only once, leaving the subprocess running #8157

Closed
1 task done
Tiger3018 opened this issue Apr 28, 2024 · 0 comments · Fixed by #8158
Closed
1 task done

gradio-cli accept SIGINT only once, leaving the subprocess running #8157

Tiger3018 opened this issue Apr 28, 2024 · 0 comments · Fixed by #8158
Assignees
Labels
bug Something isn't working

Comments

@Tiger3018
Copy link
Contributor

Describe the bug

When using gradio-cli, the SIGINT(2) or Ctrl+C passed to the gradio-cli will call self.server.close() and terminate the cli immediately.

However, there are circumstances when the launch() can't finish the jobs of thread join, such as #7051(thread.join()) and http_server.watch_thread.join(), or run into another block_thread() when debug=True.

When loaded with models, silent subprocess running will cause unnecessary RAM usage.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

def transcribe(stream, new_audio_chunk):
    return "", None

demo = gr.Interface(
    transcribe,
    ["state", gr.Audio(sources=["microphone"], streaming=True, )]
,
    ["state", "text"],
    live=True,
)

demo.launch(share=False, debug=True)
gradio app.py

Screenshot

No response

Logs

No response

System Info

------------------------------
Operating System: Darwin
gradio version: 4.27.0
gradio_client version: 0.15.1
------------------------------------------------
gradio dependencies in your environment:
aiofiles: 23.2.1
altair: 5.3.0
fastapi: 0.110.2
ffmpy: 0.3.2
gradio-client==0.15.1 is not installed.
httpx: 0.27.0
huggingface-hub: 0.22.1
importlib-resources: 6.4.0
jinja2: 3.1.3
markupsafe: 2.1.3
matplotlib: 3.8.0
numpy: 1.26.4
orjson: 3.10.1
packaging: 23.2
pandas: 2.1.4
pillow: 10.2.0
pydantic: 2.5.3
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.0
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.9.0
urllib3: 2.0.7
uvicorn: 0.29.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.
gradio_client dependencies in your environment:
fsspec: 2023.10.0
httpx: 0.27.0
huggingface-hub: 0.22.1
packaging: 23.2
typing-extensions: 4.9.0
websockets: 11.0.3

Severity

I can work around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants