Add Linux support: cross-platform restart, nvidia-ml-py dep, README update

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 23:47:05 +03:00
parent 5f90336edd
commit c95c6e9a44
4 changed files with 56 additions and 10 deletions

View File

@@ -273,19 +273,26 @@ STORE_MAP = {
"profiles": "profiles_file",
}
_RESTART_SCRIPT = Path(__file__).resolve().parents[4] / "restart.ps1"
_SERVER_DIR = Path(__file__).resolve().parents[4]
def _schedule_restart() -> None:
"""Spawn restart.ps1 after a short delay so the HTTP response completes."""
"""Spawn a restart script after a short delay so the HTTP response completes."""
def _restart():
import time
time.sleep(1)
subprocess.Popen(
["powershell", "-ExecutionPolicy", "Bypass", "-File", str(_RESTART_SCRIPT)],
creationflags=subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP,
)
if sys.platform == "win32":
subprocess.Popen(
["powershell", "-ExecutionPolicy", "Bypass", "-File",
str(_SERVER_DIR / "restart.ps1")],
creationflags=subprocess.DETACHED_PROCESS | subprocess.CREATE_NEW_PROCESS_GROUP,
)
else:
subprocess.Popen(
["bash", str(_SERVER_DIR / "restart.sh")],
start_new_session=True,
)
threading.Thread(target=_restart, daemon=True).start()