FunAudioLLM / CosyVoice

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

无法打开网页,会报错,好像和activations.py有关 #656

Open ztxxkaty opened 1 week ago

ztxxkaty commented 1 week ago

在运行代码:

python webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M-SFT|

时报错: 2024-11-18 20:22:18,313 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found. 2024-11-18 20:22:18,315 - modelscope - INFO - Loading ast index from C:\Users\Lenovo.cache\modelscope\ast_indexer 2024-11-18 20:22:18,452 - modelscope - INFO - Updating the files for the changes of local files, first time updating will take longer time! Please wait till updating done! 2024-11-18 20:22:18,465 - modelscope - INFO - AST-Scanning the path "C:\Users\Lenovo\anaconda3\envs\cosyvoice\Lib\site-packages\modelscope" with the following sub folders ['models', 'metrics', 'pipelines', 'preprocessors', 'trainers', 'msdatasets', 'exporters'] Traceback (most recent call last): File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 467, in _get_single_file_scan_result output = self.astScaner.generate_ast(file) File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 366, in generate_ast output = self.scan_import(node, show_offsets=False) File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 165, in scan_import local_out = _scan_import(el, type(el).name) File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 134, in _scan_import return self.scan_import( File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\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 25, in from cosyvoice.cli.cosyvoice import CosyVoice File "D:\TTS\CosyVoice\cosyvoice\cli\cosyvoice.py", line 18, in from modelscope import snapshot_download File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope__init__.py", line 4, in from modelscope.utils.import_utils import (LazyImportModule, File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils__init__.py", line 1, in from .hub import create_model_if_not_exist, read_config File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\hub.py", line 12, in from modelscope.utils.config import Config File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\config.py", line 22, in from modelscope.utils.import_utils import import_modules_from_file File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\import_utils.py", line 380, in class LazyImportModule(ModuleType): File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\import_utils.py", line 383, in LazyImportModule AST_INDEX = load_index() File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 723, in load_index _update_index(index, files_mtime) File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 639, in _update_index updated_index = file_scanner.get_files_scan_results(updated_files) File "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\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 "C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\site-packages\modelscope\utils\ast_utils.py", line 470, in _get_single_file_scan_result raise Exception( Exception: During ast indexing the file C:\Users\Lenovo\anaconda3\envs\cosyvoice\Lib\site-packages\modelscope\models\audio\aec\layers\activations.py, a related error excepted in the file C:\Users\Lenovo\anaconda3\envs\cosyvoice\lib\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 C:\Users\Lenovo\anaconda3\envs\cosyvoice\Lib\site-packages\modelscope\models\audio\aec\layers\activations.py to see whether the file is correctly edited.

求问,现在应该怎么做? 感谢感谢

aluminumbox commented 1 week ago

应该是python版本,试试重装

ekoz commented 1 week ago

看上去你是在 win env 上运行的,删除文件 C:\Users\your_pc_user\.cache\modelscope\ast_indexer 即可