Skip to content

When I run "python webui_en.py --port 50000 --model_dir pretrained_models/CosyVoice-300M", I got the following error: ImportError: cannot import name 'speed_change' from 'cosyvoice.utils.file_utils' #805

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

Open
Tezozomoctli opened this issue Dec 29, 2024 · 8 comments
Labels

Comments

@Tezozomoctli
Copy link

I have received the following error after setting up the environment, running:

(cosyvoice) C:\Users\Voice AI\CosyVoice\CosyVoice>python webui_en.py --port 50000 --model_dir pretrained_models/CosyVoice2-0.5B
2024-12-29 14:32:43,422 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found.
2024-12-29 14:32:43,422 - modelscope - INFO - Loading ast index from C:\Users\cache\modelscope\ast_indexer
2024-12-29 14:32:43,502 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 e984593bb28b11d497107b234faae6c2 and a total number of 980 components indexed
C:\Users\conda\envs\cosyvoice\lib\site-packages\torchvision\datapoints_init_.py:12: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: pytorch/vision#6753, and you can also check out pytorch/vision#7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
warnings.warn(BETA_TRANSFORMS_WARNING)
C:\Users\conda\envs\cosyvoice\lib\site-packages\torchvision\transforms\v2_init
.py:54: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta. While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue: pytorch/vision#6753, and you can also check out pytorch/vision#7319 to learn more about the APIs that we suspect might involve future changes. You can silence this warning by calling torchvision.disable_beta_transforms_warning().
warnings.warn(_BETA_TRANSFORMS_WARNING)
failed to import ttsfrd, use WeTextProcessing instead
Traceback (most recent call last):
File "C:\Users\Voice AI\CosyVoice\CosyVoice\webui_en.py", line 28, in
from cosyvoice.utils.file_utils import load_wav, speed_change, logging
ImportError: cannot import name 'speed_change' from 'cosyvoice.utils.file_utils' (C:\Users\Voice AI\CosyVoice\CosyVoice\cosyvoice\utils\file_utils.py)

My error seems very similar to these other ones people have brought up. Mine is slightly different in that it is about cosyvoice.utils.file_utils instead of huggingface :

#123 (comment)
#527 (comment)
#516 (comment)

So I assume I will have to do something similar and revert a version of something to an older one? I just have no idea what to do.

The reason why I have "python webui_en.py" instead of "python3 webui.py" is because this tutorial told me to:
https://www.youtube.com/watch?v=7WblOkOxkXU

Thank you,

@Tezozomoctli
Copy link
Author

Tezozomoctli commented Dec 29, 2024

Okay, this time I ran:
python webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M

I then got the familiar: "ImportError: cannot import name 'cached_download' from 'huggingface_hub' "

So, I did "pip install huggingface_hub==0.24.7", it fixed the issue.

But now I got a new issue:
FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models/CosyVoice-300M/llm.pt'

I have the folder: pretrained_models and already downloaded the CosyVoice-300M file.

@aluminumbox
Copy link
Collaborator

we dont have webui_en.py in our repo

@Tezozomoctli
Copy link
Author

Tezozomoctli commented Dec 30, 2024

we dont have webui_en.py in our repo

Correct, I changed it to tthe correct one "webui.py" but I got this new error:

FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models/CosyVoice-300M/llm.p

@aluminumbox
Copy link
Collaborator

we dont have webui_en.py in our repo

Correct, I changed it to tthe correct one "webui.py" but I got this new error:

FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models/CosyVoice-300M/llm.p

check readme for usage, follow install instruction

@zhlgx
Copy link

zhlgx commented Jan 3, 2025

设置环境哪里不对啊!
运行:python webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
错误:
安装成功!
Traceback (most recent call last):
File "M:\AIII\CosyVoice\webui.py", line 25, in
from cosyvoice.cli.cosyvoice import CosyVoice, CosyVoice2
File "M:\AIII\CosyVoice\cosyvoice\cli\cosyvoice.py", line 20, in
from cosyvoice.cli.frontend import CosyVoiceFrontEnd
File "M:\AIII\CosyVoice\cosyvoice\cli\frontend.py", line 19, in
import whisper
File "M:\AIII\CosyVoice\zhlgx\lib\site-packages\whisper.py", line 69, in
libc = ctypes.CDLL(libc_name)
File "M:\AIII\CosyVoice\zhlgx\lib\ctypes_init_.py", line 364, in init
if '/' in name or '\' in name:
TypeError: argument of type 'NoneType' is not iterable

说是环境错误!
但是我按照readme来做本地部署的,已经重做了2次,仍然是这个错误!

Copy link

github-actions bot commented Feb 3, 2025

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 3, 2025
@Tezozomoctli
Copy link
Author

@zhlgx
您是否能够解决 CosyVoice 的 TypeError: argument of type 'NoneType' is not iterable 问题?

@zhlgx
Copy link

zhlgx commented Feb 20, 2025 via email

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

No branches or pull requests

3 participants