Skip to content

Silence Hugging Face Hub anonymous-request warning#923

Merged
PavelMakarchuk merged 1 commit into
mainfrom
silence-hf-warning
May 25, 2026
Merged

Silence Hugging Face Hub anonymous-request warning#923
PavelMakarchuk merged 1 commit into
mainfrom
silence-hf-warning

Conversation

@PavelMakarchuk
Copy link
Copy Markdown
Collaborator

Summary

  • Raise the huggingface_hub logger to ERROR at CLI entry so the server-side X-HF-Warning rate-limit notice (anonymous downloads still succeed) doesn't surface to TAXSIM users
  • Real HTTP failures still raise exceptions; only informational warnings are hidden

Context

Closes #918. The warning text "You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads" is emitted by huggingface_hub.utils._http._warn_on_warning_headers when the server returns X-HF-Warning headers (which it always does for anonymous requests). PE-US downloads its calibrated microdata from HF on first use; TAXSIM users typically don't have HF accounts, and the warning reads like an error.

Test plan

  • Verified locally that huggingface_hub.utils._http warning is suppressed but ERROR-level messages still surface
  • tests/test_cli_entry_point.py + tests/test_stitched_runner.py pass
  • CI passes

🤖 Generated with Claude Code

Closes #918.

PE-US downloads its calibrated microdata from the Hugging Face Hub
on first use. Anonymous requests succeed under the lower rate limit
but trigger a server-side X-HF-Warning header that huggingface_hub
logs at WARNING level. TAXSIM users rarely have HF accounts and
the message reads like an error; raise the huggingface_hub logger
to ERROR so transient/informational notices stay hidden while real
HTTP failures (which raise exceptions) still surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-taxsim Ready Ready Preview, Comment May 25, 2026 6:28pm

Request Review

@PavelMakarchuk PavelMakarchuk merged commit 6750454 into main May 25, 2026
12 checks passed
@PavelMakarchuk PavelMakarchuk deleted the silence-hf-warning branch May 25, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hugging Face error message

1 participant