Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 5, 2021
1 parent 9f6766b commit 09a104e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/events-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Nightly events
# https://jasonet.co/posts/scheduled-actions/
# https://github.jparrowsec.cnmunity/t/distinct-job-for-each-schedule/17811/2
on:
push: {}
schedule:
- cron: "0 0 * * *" # At the end of every day

Expand Down
11 changes: 8 additions & 3 deletions requirements/adjust_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
"1.8.0": dict(torchvision="0.9.0", torchtext="0.9"),
}

system = platform.system()

def find_latest(ver: str, versions_all: list):
options = [v for v in versions_all if v.startswith(ver)]
assert options, f"missing {ver} among {versions_all}"
return sorted(options)[-1]


def main(path_req: str, torch_version: str = None) -> None:
Expand All @@ -26,9 +30,10 @@ def main(path_req: str, torch_version: str = None) -> None:
if not torch_version:
import torch
torch_version = torch.__version__
assert torch_version, f"Torch: {torch_version}"
assert torch_version, f"invalid/missing Torch: {torch_version}"

dep_versions = VERSIONS_LUT.get(torch_version, VERSIONS_NONE)
torch_version = find_latest(torch_version, list(VERSIONS_LUT.keys()))
dep_versions = VERSIONS_LUT[torch_version]
dep_versions["torch"] = torch_version
for lib in dep_versions:
version = dep_versions[lib]
Expand Down

0 comments on commit 09a104e

Please sign in to comment.