Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CI] [GHA] Use HF cache in PyTorch models/layer tests (#32273)

Andrei Kashchikhin6e3c2db2ac72
diff --git a/.github/workflows/job_pytorch_layer_tests.yml b/.github/workflows/job_pytorch_layer_tests.yml
index 30cd8015be6..daf64c29221 100644
--- a/.github/workflows/job_pytorch_layer_tests.yml
+++ b/.github/workflows/job_pytorch_layer_tests.yml
@@ -26,6 +26,8 @@ permissions: read-all
env:
PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux
PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"
+ HF_HUB_CACHE_LIN: /mount/caches/huggingface
+ HF_HUB_CACHE_WIN: "C:\\mount\\caches\\huggingface"
jobs:
PyTorch_Layer_Tests:
diff --git a/.github/workflows/job_pytorch_models_tests.yml b/.github/workflows/job_pytorch_models_tests.yml
index 63ea891dc3d..c053e0794ed 100644
--- a/.github/workflows/job_pytorch_models_tests.yml
+++ b/.github/workflows/job_pytorch_models_tests.yml
@@ -19,6 +19,10 @@ on:
permissions: read-all
+env:
+ HF_HUB_CACHE_LIN: /mount/caches/huggingface
+ HF_HUB_CACHE_WIN: "C:\\mount\\caches\\huggingface"
+
jobs:
PyTorch_Models_Tests:
name: PyTorch Models tests
@@ -67,9 +71,8 @@ jobs:
name: openvino_tokenizers_wheel
path: ${{ env.INSTALL_DIR }}
- - name: Setup HuggingFace Cache Directory (Windows)
- if: runner.os == 'Windows'
- run: Add-Content -Path $env:GITHUB_ENV -Value "HF_HUB_CACHE=C:\\mount\\caches\\huggingface"
+ - name: Setup Variables
+ run: echo "HF_HUB_CACHE=${{ runner.os == 'Linux' && env.HF_HUB_CACHE_LIN || env.HF_HUB_CACHE_WIN }}" >> "$GITHUB_ENV"
- name: Extract OpenVINO artifacts
run: pigz -dc openvino_tests.tar.gz | tar -xf - -v