Skip to content

Commit

Permalink
fix setup.py again
Browse files Browse the repository at this point in the history
  • Loading branch information
stefdoerr committed Feb 14, 2025
1 parent 718e401 commit a302aab
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@


# If WITH_CUDA is defined
if os.getenv("WITH_CUDA") is None:
if os.environ.get("WITH_CUDA", "0") == "1":
use_cuda = True
elif os.environ.get("WITH_CUDA", "0") == "0":
use_cuda = False
else:
raise ValueError("Invalid flag with WITH_CUDA environment variable. Expected '0' or '1'")
env_with_cuda = os.getenv("WITH_CUDA")
if env_with_cuda is not None:
if env_with_cuda not in ("0", "1"):
raise ValueError(
"Invalid flag with WITH_CUDA environment variable. Expected '0' or '1'"
)
use_cuda = env_with_cuda == "1"
else:
use_cuda = torch.cuda._is_compiled()

Expand Down

0 comments on commit a302aab

Please sign in to comment.