mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
@@ -91,11 +91,10 @@ def run(command, desc=None, errdesc=None, custom_env=None, live: bool = default_
|
||||
|
||||
def _torch_version() -> tuple[str, str]:
|
||||
"""Given `2.10.0.dev20251111+cu130` ; Return `("2.10.0", "cu130")`"""
|
||||
stdout: str = run("pip show torch")
|
||||
for line in stdout.split("\n"):
|
||||
if line.startswith("Version"):
|
||||
m = re.search(r"(\d+\.\d+\.\d+)(?:[^+]+)?\+(.+)", line)
|
||||
break
|
||||
import importlib.metadata
|
||||
|
||||
ver = importlib.metadata.version("torch")
|
||||
m = re.search(r"(\d+\.\d+\.\d+)(?:[^+]+)?\+(.+)", ver)
|
||||
return m.group(1), m.group(2)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ def patch(symlink: bool):
|
||||
|
||||
assert isinstance(command, list)
|
||||
|
||||
if "pip" not in command or "install" not in command:
|
||||
if "pip" not in command:
|
||||
return subprocess.__original_run(*_original_args, **_original_kwargs)
|
||||
|
||||
cmd = command[command.index("pip") + 1 :]
|
||||
|
||||
Reference in New Issue
Block a user