mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2025-06-08 22:56:24 -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):
|
def stop(self):
|
||||||
"""Stop the server process."""
|
"""Stop the server process."""
|
||||||
if self.process:
|
if self.process:
|
||||||
logger.info("Terminating llama-server...")
|
|
||||||
self.process.terminate()
|
self.process.terminate()
|
||||||
try:
|
try:
|
||||||
self.process.wait(timeout=5)
|
self.process.wait(timeout=5)
|
||||||
|
|
|
@ -61,7 +61,8 @@ 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.")
|
||||||
|
|
||||||
# Try to stop the model if loaded
|
# Explicitly stop LlamaServer to avoid __del__ cleanup issues during shutdown
|
||||||
|
if shared.model and shared.model.__class__.__name__ == 'LlamaServer':
|
||||||
try:
|
try:
|
||||||
shared.model.stop()
|
shared.model.stop()
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Reference in a new issue