Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40779 +/- ##
==========================================
+ Coverage 79.83% 79.85% +0.02%
==========================================
Files 494 494
Lines 83575 83582 +7
==========================================
+ Hits 66722 66747 +25
+ Misses 16853 16835 -18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bvolpato
force-pushed
the
bvolpato/huggingface-api-error-reporting
branch
2 times, most recently
from
November 3, 2026 03:46
74c1d31 to
48dcc1f
Compare
The handler passed an authorization header on each request, which replaced the header of the session. When the token came from the HF_TOKEN environment variable, the request sent Bearer None and the provider rejected it. Reuse the authorization established when loading the session. Also pass the URL to the API URL log call, which printed a literal %s.
bvolpato
force-pushed
the
bvolpato/huggingface-api-error-reporting
branch
from
November 4, 2026 15:19
48dcc1f to
3605e47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related #30799.
When the token comes from
HF_TOKEN, the redundant request header replaces the valid session header withBearer None, and the provider rejects the request. Reuse the authorization established when loading the session.Pass the URL to the API URL log call, which currently prints a literal
%s.The HTTP error handling from the first version of this change landed separately in #40953. This PR keeps that handling and adds regression checks for it.
In a real pipeline against a local fake endpoint, current master sends
Bearer Nonefor theHF_TOKENfallback, and this change sends the real token. The token regression check fails without this change and passes with it. The module tests, Ruff, and YAPF ran locally. The live Inference API tests need a token, so they were not run.