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

web_ui startup failed: ImportError: cannot import name 'cached_download' from 'huggingface_hub' #516

Open
ipc-robot opened this issue Oct 18, 2024 · 6 comments

Comments

@ipc-robot
Copy link

Describe the bug
pydoc.ErrorDuringImport: problem in cosyvoice.flow.flow_matching - ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/home/ipc1/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/huggingface_hub/init.py)

To Reproduce
Steps to reproduce the behavior:

cd CosyVoice
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M-Instruct

Expected behavior
Should launch a web interface as described in the documentation, but it does not!!!

Desktop (please complete the following information):

  • OS: [ubuntu 18.04 LTS]

I use pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com to install all requirements.

@ipc-robot ipc-robot changed the title web_ui根本启动不了。 web_ui startup failed: ImportError: cannot import name 'cached_download' from 'huggingface_hub' Oct 18, 2024
@CoArrayLiu
Copy link

解决了吗,我也遇到了这个问题
problem in cosyvoice.flow.flow_matching - ImportError: cannot import name 'cached_download' from 'huggingface_hub' (/home/coarrayliu/Applications/anaconda3/envs/cosyvoice/lib/python3.8/site-packages/huggingface_hub/init.py)

@HouIP
Copy link

HouIP commented Oct 18, 2024

downgrade to older version, i use
pip install huggingface_hub==0.24.7
which solve the issue for me.

@Woolverine94
Copy link

@ipc-robot

May I suggest you try to downgrade huggingface_hub to 0.25.2 ?

Something like pip install huggingface-hub==0.25.2 in the conda environment

@daveleee
Copy link

downgrade to older version, i use pip install huggingface_hub==0.24.7 which solve the issue for me.

@HouIP Thank you for saving my time!

@WindZh03
Copy link

WindZh03 commented Nov 7, 2024

downgrade to older version, i use pip install huggingface_hub==0.24.7 which solve the issue for me.

This solved my problem, thank you.

@Wauplin
Copy link
Contributor

Wauplin commented Jan 15, 2025

Hey there, maintainer of huggingface_hub here. Sorry for all the trouble this breaking change introduced. The best
-and future proof- solution to fix this is to upgrade diffusers version to a more recent version (>=0.29.0).

pip install "diffusers>=0.29.0"

This fixed version dates back to June 2024. The issue with pinning huggingface_hub to an old version is that it might conflict with future versions of diffusers/transformers.

Hope this will prove useful 🙏

Wauplin added a commit to Wauplin/CosyVoice that referenced this issue Jan 15, 2025
As mentioned in FunAudioLLM#516 (comment) and FunAudioLLM#527 (comment), it is more future-proof to upgrade `diffusers` version rather than downgrading `huggingface_hub` to an old one. This will also fix the `cannot import name 'cached_download' from 'huggingface_hub'` issue without relying on outdated packages.

Sorry again for the inconvenience 🙏
syaofox pushed a commit to syaofox/CosyVoice that referenced this issue Mar 4, 2025
As mentioned in FunAudioLLM#516 (comment) and FunAudioLLM#527 (comment), it is more future-proof to upgrade `diffusers` version rather than downgrading `huggingface_hub` to an old one. This will also fix the `cannot import name 'cached_download' from 'huggingface_hub'` issue without relying on outdated packages.

Sorry again for the inconvenience 🙏
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

7 participants