Repository navigation
Unsloth Studio: raise the huggingface_hub floor to what the pinned Diffusers main build needs - #11625
Conversation
…ffusers main build needs diffusers reads httpx out of huggingface_hub.utils, a forwarding shim that only exists from hub 1.31, and it does so in utils/hub_utils.py, so plain `import diffusers` fails on an older hub and every model on the diffusers engine is unreachable, not just Qwen-Image-2.1. The pinned main build declares huggingface-hub>=1.31.0,<2.0. Unsloth declared >=1.23.0, which was the floor the diffusers RELEASE wanted; unslothai#11405 pinned a main commit with a higher floor and left this one behind. Anything resolved into the gap satisfies Unsloth, breaks diffusers, and nothing in the install says so.
base.txt has never declared huggingface_hub. The fifth place that moved to the 1.x window is the studio extra in pyproject.toml.
|
Review record for #11625, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#66. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
…ffusers main build needs (unslothai#11625) * Unsloth Studio: raise the huggingface_hub floor to what the pinned Diffusers main build needs diffusers reads httpx out of huggingface_hub.utils, a forwarding shim that only exists from hub 1.31, and it does so in utils/hub_utils.py, so plain `import diffusers` fails on an older hub and every model on the diffusers engine is unreachable, not just Qwen-Image-2.1. The pinned main build declares huggingface-hub>=1.31.0,<2.0. Unsloth declared >=1.23.0, which was the floor the diffusers RELEASE wanted; unslothai#11405 pinned a main commit with a higher floor and left this one behind. Anything resolved into the gap satisfies Unsloth, breaks diffusers, and nothing in the install says so. * Correct the list of files that carry the hub floor base.txt has never declared huggingface_hub. The fifth place that moved to the 1.x window is the studio extra in pyproject.toml. * Shorten the hub floor comment in the macOS arm64 overrides --------- Co-authored-by: Daniel Han <[email protected]>
On an environment whose
huggingface_hubresolved below 1.31, plainimport diffusersfails:So it is not one model. Every image and video model on the diffusers engine is unreachable. Reported against Unsloth Studio v0.1.814-beta, loading Qwen-Image-2.1-GGUF Q4_K_M.
Cause
diffusers reads
httpxout ofhuggingface_hub.utilsinutils/hub_utils.pyandpipelines/pipeline_utils.py. Hub only grew that name at 1.31, as a forwarding shim inutils/__init__.pythat re-exports the realhttpxmodule.utils/hub_utils.pyis reached bydiffusers/__init__.py, which is why the whole package goes down rather than one pipeline.The pinned main build declares the floor correctly. Unsloth did not:
diffusers @ 80c7ed26(diffusers-main.txt)huggingface-hub>=1.31.0,<2.0huggingface-hub>=1.23.0,<2.01.23.0 is the floor the diffusers release wanted, set for MiniMax-H3 and recorded as such in
overrides-darwin-arm64.txt. #11405 then pinned a main commit with a higher floor and left this one where it was. A fresh resolve picks the newest hub and is fine, which is why this did not show up in testing; an environment carrying an older hub forward satisfies Unsloth, fails diffusers, and nothing in the install says so.Change
The py>=3.10 floor moves to 1.31.0 in the five places that declare it, and the comment in
overrides-darwin-arm64.txtsays where the new number comes from. The quoted uv error in that comment keeps its original1.23.0, because it is a transcript of an error that was actually seen.The py<3.10 lines are untouched. That interpreter cannot run the main build at all:
_diffusers_main_stepreturns early below 3.10.Nothing caps hub below 1.31 on py>=3.10. Every installed distribution in a working Studio env was checked, and the sub-1.31 entries are all floors with no ceiling: transformers
>=1.5.0, datasets>=0.25.0, tokenizers>=0.16.4,<2.0, data-designer<2,>=0.34.0, peft>=0.25.0, accelerate>=0.21.0.This also repairs an installation that is already in the gap.
_skip_stepasks whether the installed packages satisfy the file rather than whether the file changed, so a floor of 1.31.0 makes that step unsatisfied on the next update and hub is pulled up.Verification
Scratch venv on Windows 11, diffusers installed from the pinned commit's zip with
--no-depsso hub stays where it was put:import diffusersImportError: cannot import name 'httpx' from 'huggingface_hub.utils'ModuleNotFoundError: torch, which is the empty venv and not the shimThe 1.30.0 row is the reporter's message verbatim.
diffusers.utils,diffusers.utils.hub_utilsanddiffusers.pipelines.pipeline_utilseach fail the same way at 1.30.0.pytest tests/studio/install/test_diffusers_pin.py tests/studio/install/test_base_requirements_reach_install.pypasses, 62 tests, at21066587c9.The wider
tests/studio/install/run is red on this machine, but not from this diff:test_uv_boolish_parity.pyalone fails 380 of 544 on stockd6806d3613with nothing applied. I have not attributed the rest of that suite's failures either way.Not run: a full Studio install resolving from the changed files. The change is five requirement lines, and the floor it moves to is the one diffusers itself declares.
Cross-platform check (staging CI)
Each job installs
huggingface_hub==1.30.0first, thenstudio.txt, then the pinned Diffusers build (withoverrides-darwin-arm64.txtapplied throughUV_OVERRIDEon Apple Silicon, as the installer does), then importshuggingface_hub,diffusersandQwenImage21Pipeline. Base reads the requirement files frommain, head from this PR.main)1.30.0,ImportError: cannot import name 'httpx' from 'huggingface_hub.utils'1.32.0,hub 1.32.0 diffusers 0.41.0.dev0 import OK1.32.0, import OK1.32.0, import OK1.32.0, import OK1.32.0, import OKSo the gap is reachable on a fresh resolve on Apple Silicon, where the override file held the old floor, and this PR closes it. Linux and Windows are unchanged. 12 jobs, 2 red, both base on macos-15.