From f9e5e22e6bb1e121350fddddd9f2fd9e518ff264 Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Tue, 20 May 2025 08:52:33 -0700 Subject: [PATCH] User-agent on CI snapshot download --- tests/conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 8ab8fd6a4..964d73bd6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -58,11 +58,15 @@ def snapshot_download_w_retry(*args, **kwargs): """ with hf_offline_context(True): try: - return snapshot_download(*args, **kwargs) + return snapshot_download( + *args, user_agent={"is_ci": "true", "axolotl": "ci"}, **kwargs + ) except LocalEntryNotFoundError: pass with hf_offline_context(False): - return snapshot_download(*args, **kwargs) + return snapshot_download( + *args, user_agent={"is_ci": "true", "axolotl": "ci"}, **kwargs + ) @pytest.fixture(scope="session", autouse=True)