mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-07 14:17:09 -04:00
Stop model during graceful shutdown (#7042)
This commit is contained in:
parent
3d676cd50f
commit
3829507d0f
1 changed files with 8 additions and 0 deletions
|
@ -60,6 +60,14 @@ from modules.utils import gradio
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
def signal_handler(sig, frame):
|
||||||
logger.info("Received Ctrl+C. Shutting down Text generation web UI gracefully.")
|
logger.info("Received Ctrl+C. Shutting down Text generation web UI gracefully.")
|
||||||
|
|
||||||
|
# Explicitly stop LlamaServer to avoid __del__ cleanup issues during shutdown
|
||||||
|
if shared.model and shared.model.__class__.__name__ == 'LlamaServer':
|
||||||
|
try:
|
||||||
|
shared.model.stop()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue