mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-07 07:33:47 +00:00
Make repeated Ctrl+C force a shutdown
This commit is contained in:
parent
4f82b71ef3
commit
fdd8e5b1fd
1 changed files with 4 additions and 0 deletions
|
|
@ -33,6 +33,10 @@ warnings.filterwarnings('ignore', category=UserWarning, message='Field "model_na
|
|||
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
# On second Ctrl+C, force an immediate exit
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
||||
|
||||
logger.info("Received Ctrl+C. Shutting down Text Generation Web UI gracefully.")
|
||||
|
||||
# Explicitly stop LlamaServer to avoid __del__ cleanup issues during shutdown
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue