Fix bad merge
This commit is contained in:
-68
@@ -11,14 +11,7 @@ uv install strategy (in order):
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
<<<<<<< HEAD
|
||||
import argparse
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
import argparse
|
||||
=======
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
@@ -214,10 +207,6 @@ def _uv_pip(uv: list[str], args: list[str]) -> None:
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
def detect_and_install(
|
||||
uv: list[str],
|
||||
force_backend: str | None = None,
|
||||
@@ -232,17 +221,6 @@ def detect_and_install(
|
||||
f"[kawai] Backend: {info.backend}{forced_note} | "
|
||||
f"{info.vendor} / {info.device_name} / {info.vram_gb:.1f} GB / tier={info.tier}"
|
||||
)
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
=======
|
||||
def detect_and_install(uv: list[str]) -> dict:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
from backends import hardware
|
||||
|
||||
info = hardware.detect()
|
||||
print(f"[kawai] Detected: {info.vendor} / {info.device_name} / {info.vram_gb:.1f} GB / tier={info.tier}")
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
|
||||
_uv_pip(uv, hardware.torch_install_args(info))
|
||||
_uv_pip(uv, ["-r", str(ROOT / "requirements.txt")])
|
||||
@@ -253,14 +231,7 @@ def detect_and_install(uv: list[str]) -> dict:
|
||||
"device_name": info.device_name,
|
||||
"vram_gb": info.vram_gb,
|
||||
"tier": info.tier,
|
||||
<<<<<<< HEAD
|
||||
"forced": bool(force_backend and force_backend != "auto"),
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
"forced": bool(force_backend and force_backend != "auto"),
|
||||
=======
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
}
|
||||
HARDWARE_CACHE.write_text(json.dumps(payload, indent=2))
|
||||
MARKER.write_text("ok")
|
||||
@@ -274,24 +245,12 @@ def already_in_venv() -> bool:
|
||||
return False
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
def relaunch_in_venv(forwarded_args: list[str]) -> None:
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
def relaunch_in_venv(forwarded_args: list[str]) -> None:
|
||||
=======
|
||||
def relaunch_in_venv() -> None:
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
"""Re-exec the launcher inside the venv. Use subprocess on Windows because
|
||||
os.execv mangles argv with spaces in paths."""
|
||||
print("[kawai] Relaunching inside venv...")
|
||||
py = str(venv_python())
|
||||
script = str(ROOT / "launcher.py")
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
argv = [py, script, *forwarded_args]
|
||||
if os.name == "nt":
|
||||
result = subprocess.run(argv)
|
||||
@@ -340,23 +299,6 @@ def main() -> None:
|
||||
if not MARKER.exists():
|
||||
uv = _ensure_uv()
|
||||
detect_and_install(uv, force_backend=forced, force_vendor=args.vendor)
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
=======
|
||||
if os.name == "nt":
|
||||
result = subprocess.run([py, script])
|
||||
sys.exit(result.returncode)
|
||||
else:
|
||||
os.execv(py, [py, script])
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if already_in_venv():
|
||||
if not MARKER.exists():
|
||||
uv = _ensure_uv()
|
||||
detect_and_install(uv)
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
from app import run
|
||||
run()
|
||||
return
|
||||
@@ -364,18 +306,8 @@ def main() -> None:
|
||||
uv = _ensure_uv()
|
||||
_create_venv(uv)
|
||||
if not MARKER.exists():
|
||||
<<<<<<< HEAD
|
||||
detect_and_install(uv, force_backend=forced, force_vendor=args.vendor)
|
||||
relaunch_in_venv(sys.argv[1:])
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
detect_and_install(uv, force_backend=forced, force_vendor=args.vendor)
|
||||
relaunch_in_venv(sys.argv[1:])
|
||||
=======
|
||||
detect_and_install(uv)
|
||||
relaunch_in_venv()
|
||||
>>>>>>> refs/remotes/azuze/main
|
||||
>>>>>>> 965a3d97c6dae38fa25174559b1ea0f3050788f9
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user