Pin huggingface_hub==0.25.2 in sd-turbo example - #583
Open
kzys wants to merge 1 commit into
Open
Conversation
The sd-turbo truss fails to deploy: the model server crash-loops with
"Exception while loading model" a few seconds into model.load(), and the
deployment never becomes healthy.
The root cause is an import error. huggingface_hub is not pinned, and the
pinned diffusers==0.23.1 imports symbols that were removed from newer
huggingface_hub releases (resolved 0.36.x at build time):
File "diffusers/utils/dynamic_modules_utils.py", line 28, in <module>
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub'
huggingface_hub 0.25.2 is the last release that still provides
cached_download and HfFolder, and it satisfies the constraints of the
pinned transformers==4.35.2 (<1.0) and diffusers==0.23.1 (>=0.13.2).
Verified on Baseten: with this pin the model loads in ~37s and inference
returns a valid image.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kzys
force-pushed
the
fix-sd-turbo-hf-hub-pin
branch
from
July 29, 2026 18:47
cb4f121 to
036a1cc
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.
Problem
The
stable-diffusion/sd-turboexample fails to deploy. The model server crash-loops duringmodel.load()and the deployment never becomes healthy. The runtime logs only show:Root cause
huggingface_hubis not pinned inconfig.yaml, whilediffusersis pinned to 0.23.1 (Nov 2023). Fresh builds now resolvehuggingface_hub0.36.x, which removedcached_downloadandHfFolder— symbols that diffusers 0.23.1 imports at module load. Reproduced locally withdiffusers==0.23.1+huggingface_hub==0.36.2:(The
ImportErrorfires ~3s after "Loading truss model from file", which is why the platform logs show no traceback — the model module never finishes importing.)Fix
Pin
huggingface_hub==0.25.2— the last release that still providescached_download/HfFolder, and compatible with the example's pinnedtransformers==4.35.2(requires<1.0) anddiffusers==0.23.1(requires>=0.13.2).Verification
Deployed to Baseten with this pin: build passes,
model.load()completes in ~37s, and a test request ({"prompt": "A tree in a field under the night sky", "num_steps": 1}) returns a valid 512×512 image in under 2 seconds.🤖 Generated with Claude Code