Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try re-using huggingface cache in GitHub Actions #1571

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 10 additions & 1 deletion .github/workflows/catalog_preparation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true

jobs:
preparation:

Expand All @@ -21,6 +21,7 @@ jobs:
HF_HUB_VERBOSITY: error
HF_DATASETS_DISABLE_PROGRESS_BARS: "True"
TQDM_DISABLE: "True"
HF_HOME: .cache/huggingface

strategy:
matrix:
Expand All @@ -33,6 +34,14 @@ jobs:
with:
python-version: '3.9'

- name: Cache Hugging Face Cache
uses: actions/cache@v4
with:
path: .cache/huggingface
key: huggingface-cache-${{ github.run_id }}
restore-keys: |
huggingface-cache

- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv pip install --system ".[tests]"
- run: huggingface-cli login --token ${{ secrets.UNITXT_READ_HUGGINGFACE_HUB_FOR_TESTS }}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ jobs:
HF_HUB_VERBOSITY: error
HF_DATASETS_DISABLE_PROGRESS_BARS: "True"
TQDM_DISABLE: "True"
HF_HOME: ~/.cache/huggingface
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Cache Hugging Face Cache
uses: actions/cache@v3
with:
path: ~/.cache/huggingface
key: huggingface-cache

- name: Install Requirements
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
Expand Down
14 changes: 7 additions & 7 deletions prepare/cards/cohere_for_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@
"2. machine-translations of handpicked examples into 101 languages →… See the full description on the dataset page: https://huggingface.co/datasets/CohereForAI/aya_evaluation_suite."
),
)

test_card(
card,
metrics=["metrics.rag.correctness.llama_index_by_mock"],
debug=False,
strict=False,
)
if subset == "aya_human_annotated" and lang == "eng":
test_card(
card,
metrics=["metrics.rag.correctness.llama_index_by_mock"],
debug=False,
strict=False,
)
add_to_catalog(
card,
f"cards.cohere_for_ai.{subset}.{lang}",
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def setUpClass(cls):
unitxt.settings.mock_inference_mode = True
unitxt.settings.max_log_message_size = 1000000000000
unitxt.settings.loader_cache_size = 10
unitxt.settings.disable_hf_datasets_cache = True
unitxt.settings.stream_hf_datasets_by_default = True
# unitxt.settings.disable_hf_datasets_cache = True
# unitxt.settings.stream_hf_datasets_by_default = True
if settings.default_verbosity in ["error", "critical"]:
if not sys.warnoptions:
warnings.simplefilter("ignore")
Expand Down
Loading