User-agent on CI snapshot download

This commit is contained in:
Wing Lian
2025-05-20 08:52:33 -07:00
parent a27b909c5c
commit f9e5e22e6b

View File

@@ -58,11 +58,15 @@ def snapshot_download_w_retry(*args, **kwargs):
""" """
with hf_offline_context(True): with hf_offline_context(True):
try: try:
return snapshot_download(*args, **kwargs) return snapshot_download(
*args, user_agent={"is_ci": "true", "axolotl": "ci"}, **kwargs
)
except LocalEntryNotFoundError: except LocalEntryNotFoundError:
pass pass
with hf_offline_context(False): 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) @pytest.fixture(scope="session", autouse=True)