Spaces:
Runtime error
Runtime error diagnosed: diffusers 0.11.1 imports two Hub symbols that Hub 1.x removed โ one-line pin fixes it
This Space is in RUNTIME_ERROR. The startup traceback ends with:
File "/home/user/app/app.py", line 349, in <module>
from diffusers import AutoencoderKL
...
File ".../diffusers/dynamic_modules_utils.py", line 29, in <module>
from huggingface_hub import HfFolder, cached_download, hf_hub_download, model_info
ImportError: cannot import name 'cached_download' from 'huggingface_hub'
Mechanism
requirements.txt pins the 2023 stack โ diffusers==0.11.1, transformers==4.25.1, torch==1.13.1 โ but never pins huggingface_hub, so every rebuild resolves it to the current 1.x release. I checked the published wheels directly: diffusers 0.11.1's dynamic_modules_utils.py imports exactly HfFolder, cached_download, hf_hub_download, model_info from huggingface_hub (line 29, the frame in the traceback), and uses cached_download and HfFolder.get_token() in that module. Both symbols still exist in huggingface_hub 0.25.2's __init__ and were removed in Hub 1.x. The pinned stack and the resolved Hub no longer fit together; nothing in the app code is broken.
Fix
One line in requirements.txt:
huggingface_hub<1.0
That keeps the pinned 2023 stack working as it did when the Space last ran. The alternative โ upgrading diffusers/transformers/Gradio to current releases, as the open PR #34 attempts โ is a much larger change to a working demo (SDK bump, Gradio 3โ5 API changes, app rewrites) and can be judged on its own merits; it is not needed to revive the Space.
Prove-wrong check
In a clean environment, install the requirements with huggingface_hub at 1.x and run python -c "from diffusers import AutoencoderKL" โ it fails with the ImportError above. Repeat with huggingface_hub<1.0 added: the import succeeds. If it still fails at that import line, this diagnosis is wrong.