From 369717dc39202f46c38b86fb2b70cc30c9de1d28 Mon Sep 17 00:00:00 2001 From: Crystalcareai <162942000+Crystalcareai@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:32:14 -0500 Subject: [PATCH] remove xformers dependency --- setup.py | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/setup.py b/setup.py index 9e6f34ad81..21b7a39ab1 100644 --- a/setup.py +++ b/setup.py @@ -29,37 +29,10 @@ def parse_requirements(): _install_requires.append(line) try: - xformers_version = [req for req in _install_requires if "xformers" in req][0] - if "Darwin" in platform.system(): - # don't install xformers on MacOS - _install_requires.pop(_install_requires.index(xformers_version)) - else: - # detect the version of torch already installed - # and set it so dependencies don't clobber the torch version - torch_version = version("torch") - _install_requires.append(f"torch=={torch_version}") - - version_match = re.match(r"^(\d+)\.(\d+)(?:\.(\d+))?", torch_version) - if version_match: - major, minor, patch = version_match.groups() - major, minor = int(major), int(minor) - patch = ( - int(patch) if patch is not None else 0 - ) # Default patch to 0 if not present - else: - raise ValueError("Invalid version format") - - if (major, minor) >= (2, 3): - if patch == 0: - _install_requires.pop(_install_requires.index(xformers_version)) - _install_requires.append("xformers>=0.0.26.post1") - elif (major, minor) >= (2, 2): - _install_requires.pop(_install_requires.index(xformers_version)) - _install_requires.append("xformers>=0.0.25.post1") - else: - _install_requires.pop(_install_requires.index(xformers_version)) - _install_requires.append("xformers>=0.0.23.post1") - + # detect the version of torch already installed + # and set it so dependencies don't clobber the torch version + torch_version = version("torch") + _install_requires.append(f"torch=={torch_version}") except PackageNotFoundError: pass