Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ runs:
references/requirements.txt
demo/pt-requirements.txt

# A pull request only restores: a branch-scoped copy it saved would be
# visible to nothing else and would evict main's, which every run reuses.
- name: Cache pretrained models
if: inputs.cache-models == 'true'
if: inputs.cache-models == 'true' && github.event_name == 'push'
uses: actions/cache@v6
with:
path: |
Expand All @@ -49,6 +51,15 @@ runs:
# Bump the -v1 suffix to invalidate if the set of models a job uses changes
key: doctr-models-${{ github.job }}-v1

- name: Restore pretrained models
if: inputs.cache-models == 'true' && github.event_name != 'push'
uses: actions/cache/restore@v6
with:
path: |
~/.cache/doctr
~/.cache/huggingface
key: doctr-models-${{ github.job }}-v1

# The default PyPI torch wheel on Linux bundles CUDA (multi-GB) which CI
# runners can't use. Pre-installing CPU wheels satisfies the torch
# requirement so the package install below won't pull the CUDA build.
Expand Down
Loading