diff --git a/studio/backend/core/inference/llama_cpp.py b/studio/backend/core/inference/llama_cpp.py index 0ab6716cac..ee04a91e85 100644 --- a/studio/backend/core/inference/llama_cpp.py +++ b/studio/backend/core/inference/llama_cpp.py @@ -6158,7 +6158,6 @@ class LlamaCppBackend: isolated, mirroring the reaper's custom-root isolation).""" try: from utils.paths.storage_roots import studio_root # noqa: WPS433 - return studio_root() / "llama-server.pid" except Exception: return None @@ -6193,7 +6192,6 @@ class LlamaCppBackend: uncertainty so an unrelated process is never killed.""" try: import psutil - try: proc = psutil.Process(pid) if (proc.name() or "").lower().startswith("llama-server"): diff --git a/studio/backend/main.py b/studio/backend/main.py index a126066e35..0b119055e2 100644 --- a/studio/backend/main.py +++ b/studio/backend/main.py @@ -482,7 +482,6 @@ async def lifespan(app: FastAPI): # Mirror run.py's _graceful_shutdown step 5 so a direct-uvicorn shutdown # (which bypasses the signal handler) also kills the GPU child. from routes.inference import _llama_cpp_backend - if _llama_cpp_backend is not None: _llama_cpp_backend._kill_process() diff --git a/studio/backend/tests/test_llama_cpp_wait_for_vram_settle.py b/studio/backend/tests/test_llama_cpp_wait_for_vram_settle.py index 1eabd9b5cf..fd7d9199b4 100644 --- a/studio/backend/tests/test_llama_cpp_wait_for_vram_settle.py +++ b/studio/backend/tests/test_llama_cpp_wait_for_vram_settle.py @@ -463,9 +463,7 @@ def test_reap_recorded_pid_skips_pid_reuse(tmp_path): try: with ( patch.object(LlamaCppBackend, "_server_pidfile_path", staticmethod(lambda: pidfile)), - patch.object( - LlamaCppBackend, "_pid_is_llama_server", staticmethod(lambda pid: False) - ), + patch.object(LlamaCppBackend, "_pid_is_llama_server", staticmethod(lambda pid: False)), ): n = LlamaCppBackend._reap_recorded_pid() assert n == 0