Skip to content

Commit d5249b7

Browse files
committed
fix-ish CI
1 parent 9e372b2 commit d5249b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_file_download.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
try_to_load_from_cache,
4646
)
4747
from huggingface_hub.utils import SoftTemporaryDirectory, get_session, hf_raise_for_status, is_hf_transfer_available
48+
from huggingface_hub.utils._headers import build_hf_headers
4849

4950
from .testing_constants import ENDPOINT_STAGING, OTHER_TOKEN, TOKEN
5051
from .testing_utils import (
@@ -1124,13 +1125,13 @@ def test_weak_reference(self):
11241125
@with_production_testing
11251126
def test_resolve_endpoint_on_regular_file(self):
11261127
url = "https://huggingface.co/gpt2/resolve/e7da7f221d5bf496a48136c0cd264e630fe9fcc8/README.md"
1127-
response = requests.head(url)
1128+
response = requests.head(url, headers=build_hf_headers(user_agent="is_ci/true"))
11281129
self.assertEqual(self._get_etag_and_normalize(response), "a16a55fda99d2f2e7b69cce5cf93ff4ad3049930")
11291130

11301131
@with_production_testing
11311132
def test_resolve_endpoint_on_lfs_file(self):
11321133
url = "https://huggingface.co/gpt2/resolve/e7da7f221d5bf496a48136c0cd264e630fe9fcc8/pytorch_model.bin"
1133-
response = requests.head(url)
1134+
response = requests.head(url, headers=build_hf_headers(user_agent="is_ci/true"))
11341135
self.assertEqual(
11351136
self._get_etag_and_normalize(response), "7c5d3f4b8b76583b422fcb9189ad6c89d5d97a094541ce8932dce3ecabde1421"
11361137
)

0 commit comments

Comments
 (0)