From 44f9cbdfc6a6cb78d76cc4978cd8f2eb0609fea7 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 19 Nov 2024 15:13:32 -0500 Subject: [PATCH] Fix torch version condition in find_pytorch.py --- backend/find_pytorch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/find_pytorch.py b/backend/find_pytorch.py index a6dce6b4d7..125fd6a389 100644 --- a/backend/find_pytorch.py +++ b/backend/find_pytorch.py @@ -131,9 +131,10 @@ def get_pt_requirement(pt_version: str = "") -> dict: # https://github.com/astral-sh/uv/blob/main/PIP_COMPATIBILITY.md#local-version-identifiers # luckily, .* (prefix matching) defined in PEP 440 can match any local version # https://peps.python.org/pep-0440/#version-matching - f"torch=={Version(pt_version).base_version}.*", + f"torch=={Version(pt_version).base_version}.*" + if pt_version != "" # https://github.com/pytorch/pytorch/commit/7e0c26d4d80d6602aed95cb680dfc09c9ce533bc - "torch>=2.1.0", + else "torch>=2.1.0" ], }