Repository navigation
[Docs] Fix HTTP migration and async session references - #5079
Merged
hanouticelina merged 2 commits intoOct 5, 2026
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Contributor
|
This PR has been shipped as part of the v2.2.0 release. |
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.
Summary
huggingface_hub.HfHubHttpError, which does not exist. Point toHfHubHTTPErrorand show thehuggingface_hub.utilsimport that works on both v0.36.0 and v1.0.0.AsyncInferenceClient/trust_envmigration advice toset_async_client_factory. The synchronous factory does not configure async sessions.get_async_clienttoget_async_session.These are documentation-only corrections; the historical v1 guide keeps its
httpxreferences. No runtime behavior changes.Verified the imports and factory behavior offline against v0.36.0, v1.0.0, and current main. For example, on v1.0.0:
make styleandmake qualityboth passed (usingmingw32-makewithPYTHONUTF8=1on Windows). Existing HTTP compatibility/session tests also passed:AI-assisted: prepared and validated with Codex.
Note
Low Risk
Documentation-only edits to the migration guide and a docstring; no library behavior changes.
Overview
Corrects v1 HTTP migration documentation and one async HTTP factory docstring so they match the real public API—no runtime behavior changes.
The migration guide now points error handling at
HfHubHTTPError(not the nonexistentHfHubHttpError) withfrom huggingface_hub.utils import HfHubHTTPError, and tells users disablingtrust_envforAsyncInferenceClientto useset_async_client_factoryinstead of the syncset_client_factory. In_http.py,set_async_client_factory’s docs now referenceget_async_sessioninstead of the missingget_async_client.Reviewed by Cursor Bugbot for commit 0648b28. Bugbot is set up for automated code reviews on this repo. Configure here.