Skip to content

Commit

Permalink
try to detect macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
egillax committed Nov 1, 2024
1 parent 279f274 commit 71d3577
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/R_CDM_check_hades.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ jobs:
library(reticulate)
virtualenv_create("r-reticulate", Sys.which("python"), packages=python_packages)
# Detect the OS and set pip options accordingly
if (Sys.info()["sysname"] == "Darwin") {
# macOS
pip_options <- NULL
} else {
# Other OS, assume Linux or Windows needing CPU torch
pip_options <- c("--index-url https://download.pytorch.org/whl/cpu")
}
virtualenv_install("r-reticulate", "torch", pip_options = c("--index-url https://download.pytorch.org/whl/cpu"))
path_to_python <- virtualenv_python("r-reticulate")
Expand Down

0 comments on commit 71d3577

Please sign in to comment.