Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cached_download no longer supported? #2

Open
cjpatton opened this issue Dec 3, 2024 · 3 comments
Open

cached_download no longer supported? #2

cjpatton opened this issue Dec 3, 2024 · 3 comments

Comments

@cjpatton
Copy link

cjpatton commented Dec 3, 2024

Related to TencentARC/InstantMesh#169, it looks like the version of huggingface_hug installed by the default dependencies no longer has the cached_download module. The code appears to be happy with an older version, 0.25.2.

@XuandongZhao
Copy link
Owner

Could you please point out which line of code causes this error?

@lagamura
Copy link

lagamura commented Mar 3, 2025

check the solution here huggingface/huggingface_hub#2617

@cjpatton
Copy link
Author

cjpatton commented Mar 6, 2025

@XuandongZhao I can reproduce on main as follows:

(.venv) ➜  PRC-Watermark git:(main) python encode.py --test_num 10
^[[1;6DTraceback (most recent call last):
  File "/Users/chris/github.com/XuandongZhao/PRC-Watermark/encode.py", line 13, in <module>
    from src.baseline.treering_watermark import tr_detect, tr_get_noise
  File "/Users/chris/github.com/XuandongZhao/PRC-Watermark/src/baseline/treering_watermark.py", line 6, in <module>
    from diffusers import DDIMInverseScheduler
  File "/Users/chris/github.com/XuandongZhao/PRC-Watermark/.venv/lib/python3.11/site-packages/diffusers/__init__.py", line 5, in <module>
    from .utils import (
  File "/Users/chris/github.com/XuandongZhao/PRC-Watermark/.venv/lib/python3.11/site-packages/diffusers/utils/__init__.py", line 36, in <module>
    from .dynamic_modules_utils import get_class_from_dynamic_module
  File "/Users/chris/github.com/XuandongZhao/PRC-Watermark/.venv/lib/python3.11/site-packages/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' (/Users/chris/github.com/XuandongZhao/PRC-Watermark/.venv/lib/python3.11/site-packages/huggingface_hub/__init__.py)

Upgrading didn't work for me: I solved this by pinning huggingface_hub==0.25.0 in requirements.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants