Skip to content

Commit

Permalink
fix for ci w/o torch
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Dec 21, 2023
1 parent c9923d3 commit fa8d851
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""setup.py for axolotl"""

from importlib.metadata import version
from importlib.metadata import PackageNotFoundError, version

from setuptools import find_packages, setup

Expand All @@ -24,10 +24,13 @@ def parse_requirements():
# Handle standard packages
_install_requires.append(line)

torch_version = version("torch")
if torch_version.startswith("2.1.1"):
_install_requires.pop(_install_requires.index("xformers==0.0.22"))
_install_requires.append("xformers==0.0.23")
try:
torch_version = version("torch")
if torch_version.startswith("2.1.1"):
_install_requires.pop(_install_requires.index("xformers==0.0.22"))
_install_requires.append("xformers==0.0.23")
except PackageNotFoundError:
pass

return _install_requires, _dependency_links

Expand Down

0 comments on commit fa8d851

Please sign in to comment.