mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-17 19:04:39 +01:00
Make repeated Ctrl+C force a shutdown
This commit is contained in:
parent
4f82b71ef3
commit
fdd8e5b1fd
|
|
@ -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…
Reference in a new issue