mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-18 01:40:25 +08:00
optimize(web): program cleanup on exit
This commit is contained in:
@@ -1639,6 +1639,14 @@ with gr.Blocks(title="RVC WebUI") as app:
|
||||
gr.Markdown(traceback.format_exc())
|
||||
|
||||
try:
|
||||
import signal
|
||||
def cleanup(signum, frame):
|
||||
signame = signal.Signals(signum).name
|
||||
print(f'Got signal {signame} ({signum})')
|
||||
app.close()
|
||||
sys.exit(0)
|
||||
signal.signal(signal.SIGINT, cleanup)
|
||||
signal.signal(signal.SIGTERM, cleanup)
|
||||
if config.iscolab:
|
||||
app.queue(max_size=1022).launch(share=True, max_threads=511)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user