mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-07 06:06:20 -04:00
Small changes
This commit is contained in:
parent
142c4eb1a6
commit
20649b9730
2 changed files with 6 additions and 6 deletions
|
@ -398,7 +398,6 @@ class LlamaServer:
|
|||
def stop(self):
|
||||
"""Stop the server process."""
|
||||
if self.process:
|
||||
logger.info("Terminating llama-server...")
|
||||
self.process.terminate()
|
||||
try:
|
||||
self.process.wait(timeout=5)
|
||||
|
|
11
server.py
11
server.py
|
@ -61,11 +61,12 @@ from modules.utils import gradio
|
|||
def signal_handler(sig, frame):
|
||||
logger.info("Received Ctrl+C. Shutting down Text generation web UI gracefully.")
|
||||
|
||||
# Try to stop the model if loaded
|
||||
try:
|
||||
shared.model.stop()
|
||||
except:
|
||||
pass
|
||||
# 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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue