You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hub requests fail with HF_HUB_DISABLE_TELEMETRY=1 (empty user agent → illegal header) #926
#510 fixed the trailing "; " in the User-Agent when telemetry is on, but the telemetry-off path still hits it. With HF_HUB_DISABLE_TELEMETRY=1, _get_hf_api() passes user_agent="", huggingface_hub appends "; " + user_agent for any string, and the header ends in "; ":
LocalProtocolError: Illegal header value b'kernels/0.17.2; hf_hub/2.2.0; python/3.13.12; '
The first call to fail is usually the trust check, which surfaces it as a trust problem instead:
ValueError: Kernel repository 'kernels-community/flash-attn2' could not verify publisher trust status. Set trust_remote_code=True ...
So get_kernel (and transformers' flash_attention_2 → kernels-community/flash-attn2 fallback) doesn't work for anyone who turns telemetry off, which is common in CI and containers.
Reproduces with kernels 0.17.2 and main (3d87832), huggingface_hub 2.2.0. Without the env var, the same call works.
Passing user_agent=user_agent_str or None in _get_hf_api fixes it. The #510 test could also run with telemetry off. It might also help if the trust check included the underlying error.
Happy to open a PR for this if that works for you.
Activity
kernels: fix malformed user-agent string when telemetry is disabled (h…