chore: use gh cache for huggingface models (#1096)

* use gh cache for huggingface models

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* increase hf timeout

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* more timeout

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* use different cache key in each job

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

---------

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi 2025-03-03 00:13:47 +01:00 committed by GitHub
parent 8dc0562542
commit 0c1e9391de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,10 @@
on:
workflow_call:
env:
HF_HUB_DOWNLOAD_TIMEOUT: "60"
HF_HUB_ETAG_TIMEOUT: "60"
jobs:
run-checks:
runs-on: ubuntu-latest
@ -14,6 +18,11 @@ jobs:
- name: Set TESSDATA_PREFIX
run: |
echo "TESSDATA_PREFIX=$(dpkg -L tesseract-ocr-eng | grep tessdata$)" >> "$GITHUB_ENV"
- name: Cache Hugging Face models
uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: huggingface-cache-py${{ matrix.python-version }}
- uses: ./.github/actions/setup-poetry
with:
python-version: ${{ matrix.python-version }}