Repository navigation
Migrate httpx imports through huggingface_hub - #4003
Conversation
|
Thanks! I pushed a small follow-up to preserve the
|
There was a problem hiding this comment.
🟡 Changes recommended
Update the migration guide so its documented Hub support range matches the package metadata.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates HTTP imports through huggingface_hub for compatibility with Hub 1.x and 2.x.
Changes:
- Adds a compatibility import with fallback support.
- Updates file I/O tests to use it.
- Allows
huggingface-hubversions below 3.0.0.
File summaries
| File | Summary |
|---|---|
tests/util/test_file_io.py |
Uses the compatibility HTTP client in tests. |
sentence_transformers/util/file_io.py |
Routes HTTP imports through huggingface_hub. |
pyproject.toml |
Expands the Hub dependency range to include 2.x; migration guidance also needs updating. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Direct
httpximports will break whenhuggingface_hubmigrates tohttpx2. Import throughhuggingface_hub.utilsinstead, using the compatibility export shipped inhuggingface_hub1.31.0. Goal is to make sentence-transformers compatible with both huggingface_hub 1.x and 2.x when the switch to httpx2 happens.Related: huggingface/huggingface_hub#4803 and huggingface/huggingface_hub#4802.