diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ffd1ca33c6d..d3718763ab2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1435,6 +1435,7 @@ jobs: env: TYPE: ${{ github.event_name == 'schedule' && 'nightly' || 'precommit'}} TEST_DEVICE: CPU + USE_SYSTEM_CACHE: False - name: Available storage after tests run: | diff --git a/tests/model_hub_tests/models_hub_common/constants.py b/tests/model_hub_tests/models_hub_common/constants.py index 01c1d9a1382..7e406f89d4d 100644 --- a/tests/model_hub_tests/models_hub_common/constants.py +++ b/tests/model_hub_tests/models_hub_common/constants.py @@ -9,9 +9,9 @@ tf_hub_cache_dir = os.environ.get('TFHUB_CACHE_DIR', os.path.join(tempfile.gettempdir(), "tfhub_modules")) os.environ['TFHUB_CACHE_DIR'] = tf_hub_cache_dir -hf_hub_cache_dir = os.environ.get('HUGGINGFACE_HUB_CACHE', - tempfile.gettempdir()) -os.environ['HUGGINGFACE_HUB_CACHE'] = hf_hub_cache_dir +hf_hub_cache_dir = tempfile.gettempdir() +if os.environ.get('USE_SYSTEM_CACHE', 'True') == 'False': + os.environ['HUGGINGFACE_HUB_CACHE'] = hf_hub_cache_dir # supported_devices : CPU, GPU, GNA test_device = os.environ.get('TEST_DEVICE', 'CPU;GPU').split(';') diff --git a/tests/model_hub_tests/torch_tests/test_torchvision_models.py b/tests/model_hub_tests/torch_tests/test_torchvision_models.py index 7b93ea68505..08deb2080a4 100644 --- a/tests/model_hub_tests/torch_tests/test_torchvision_models.py +++ b/tests/model_hub_tests/torch_tests/test_torchvision_models.py @@ -56,7 +56,8 @@ class TestTorchHubConvertModel(TestConvertModel): def setup_class(self): self.cache_dir = tempfile.TemporaryDirectory() # set temp dir for torch cache - torch.hub.set_dir(str(self.cache_dir.name)) + if os.environ.get('USE_SYSTEM_CACHE', 'True') == 'False': + torch.hub.set_dir(str(self.cache_dir.name)) def load_model(self, model_name, model_link): m = torch.hub.load("pytorch/vision", model_name,