FunAudioLLM / CosyVoice

Multi-lingual large voice generation model, providing inference, training and deployment full-stack ability.
https://funaudiollm.github.io/
Apache License 2.0
2.41k stars 219 forks source link

环境和模型都配置好了执行 python3 webui.py --port 50000 --model_dir speech_tts/CosyVoice-300M 报错 #28

Closed anstonjie closed 1 week ago

anstonjie commented 2 weeks ago

(cosyvoice) root@sincere-gold-5436-6f97dcc54d-85z5s:/home/tom/fssd/CosyVoice# python3 webui.py --port 50000 --model_dir speech_tts/CosyVoice-300M
2024-07-06 23:18:27,962 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found. 2024-07-06 23:18:27,963 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer 2024-07-06 23:18:27,996 - modelscope - INFO - Updating the files for the changes of local files, first time updating will take longer time! Please wait till updating done! 2024-07-06 23:18:28,006 - modelscope - INFO - AST-Scanning the path "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters'] Traceback (most recent call last): File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 467, in _get_single_file_scan_result output = self.astScaner.generate_ast(file) File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 366, in generate_ast output = self.scan_import(node, show_offsets=False) File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 165, in scan_import local_out = _scan_import(el, type(el).name) File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 134, in _scan_import return self.scan_import( File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 152, in scan_import attr = getattr(node, field) AttributeError: 'ClassDef' object has no attribute 'type_params'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "webui.py", line 31, in from cosyvoice.cli.cosyvoice import CosyVoice File "/home/tom/fssd/CosyVoice/cosyvoice/cli/cosyvoice.py", line 17, in from modelscope import snapshot_download File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/init.py", line 4, in from modelscope.utils.import_utils import (LazyImportModule, File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/init.py", line 1, in from .hub import create_model_if_not_exist, read_config File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/hub.py", line 12, in from modelscope.utils.config import Config File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/config.py", line 22, in from modelscope.utils.import_utils import import_modules_from_file File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/import_utils.py", line 380, in class LazyImportModule(ModuleType): File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/import_utils.py", line 383, in LazyImportModule AST_INDEX = load_index() File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 723, in load_index _update_index(index, files_mtime) File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 639, in _update_index updated_index = file_scanner.get_files_scan_results(updated_files) File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 533, in get_files_scan_results decorator_list, import_list = self._get_single_file_scan_result( File "/opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 470, in _get_single_file_scan_result raise Exception( Exception: During ast indexing the file /opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/models/audio/aec/layers/activations.py, a related error excepted in the file /opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py at line: 152: "attr = getattr(node, field)" with error msg: "AttributeError: 'ClassDef' object has no attribute 'type_params'", please double check the origin file /opt/conda/envs/cosyvoice/lib/python3.8/site-packages/modelscope/models/audio/aec/layers/activations.py to see whether the file is correctly edited. (cosyvoice) root@sincere-gold-5436-6f97dcc54d-85z5s:/home/tom/fssd/CosyVoice#

aluminumbox commented 2 weeks ago

你这个看上去感觉像是python环境的问题,试试重新生成Python环境再安装一次,这个问题从来没遇到过

abiglizi commented 2 weeks ago

你这个看上去感觉像是python环境的问题,试试重新生成Python环境再安装一次,这个问题从来没遇到过

我也是在这一步会报错,显示ttsfrd错误初始化 prepare tts engine failed Traceback (most recent call last): File "webui.py", line 182, in cosyvoice = CosyVoice(args.model_dir) File "/home/ccl-1/Documents/CosyVoice/cosyvoice/cli/cosyvoice.py", line 30, in init self.frontend = CosyVoiceFrontEnd(configs['get_tokenizer'], File "/home/ccl-1/Documents/CosyVoice/cosyvoice/cli/frontend.py", line 53, in init assert self.frd.initialize('{}/../../pretrained_models/speech_kantts_ttsfrd/resource'.format(ROOT_DIR)) is True, 'failed to initialize ttsfrd resource' AssertionError: failed to initialize ttsfrd resource

Downupanddownup commented 1 week ago

可能是modelscope的问题,删除一下~/.cache/modelscope/ast_indexer这个文件试试。https://github.com/modelscope/modelscope/issues/894

cireW commented 1 week ago

把modelscope版本退一下就可以了

aluminumbox commented 1 week ago

use iic/CosyVoice_ttsfrd instead, we have updated the repo

plusinfo commented 1 week ago

你这个看上去感觉像是python环境的问题,试试重新生成Python环境再安装一次,这个问题从来没遇到过

我也是在这一步会报错,显示ttsfrd错误初始化 prepare tts engine failed Traceback (most recent call last): File "webui.py", line 182, in cosyvoice = CosyVoice(args.model_dir) File "/home/ccl-1/Documents/CosyVoice/cosyvoice/cli/cosyvoice.py", line 30, in init self.frontend = CosyVoiceFrontEnd(configs['get_tokenizer'], File "/home/ccl-1/Documents/CosyVoice/cosyvoice/cli/frontend.py", line 53, in init assert self.frd.initialize('{}/../../pretrained_models/speech_kantts_ttsfrd/resource'.format(ROOT_DIR)) is True, 'failed to initialize ttsfrd resource' AssertionError: failed to initialize ttsfrd resource

请问这个问题解决了吗,我也是遇到了这个问题

plusinfo commented 1 week ago

把modelscope版本退一下就可以了

麻烦问下,具体回退到哪个版本呢?谢谢

cireW commented 1 week ago

把modelscope版本退一下就可以了

麻烦问下,具体回退到哪个版本呢?谢谢

1.14可以,但是推理速度很慢,建议不修改版本 删除一下~/.cache/modelscope/ast_indexer这个文件(亲测有效