From 2af9876b764bdbb6f22534f97a73ada83da88136 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 9 Jul 2024 16:08:44 +0100 Subject: [PATCH] Removed hardcoded torch version and used the one from requirements.txt --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 68ee8627a..6aec90c89 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,13 @@ from setuptools import find_packages, setup with open("requirements.txt") as f: requirements = f.read().splitlines() +# Find the torch requirement and remove it from the list +torch = next((req for req in requirements if req.startswith("torch==")), None) +if torch: + requirements.remove(torch) +else: + torch = "torch==2.2.2" # Fallback if not found in requirements.txt + from aider import __version__ from aider.help_pats import exclude_website_pats @@ -19,8 +26,6 @@ with open("README.md", "r", encoding="utf-8") as f: # Debug: Print discovered packages packages = find_packages(exclude=["benchmark"]) + ["aider.website"] print("Discovered packages:", packages) - -torch = "torch==2.2.2" pytorch_url = None with TemporaryDirectory(prefix="pytorch_download_") as temp_dir: