Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "test.py", line 1, in

from cosyvoice.cli.cosyvoice import CosyVoice

File "/mnt/workspace/CosyVoice/cosyvoice/cli/cosyvoice.py", line 18, in

from modelscope import snapshot_download

File "/root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/__init__.py", line 4, in

from modelscope.utils.import_utils import (LazyImportModule,

File "/root/miniconda3/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 "/root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/hub.py", line 12, in

from modelscope.utils.config import Config

File "/root/miniconda3/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 "/root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/import_utils.py", line 380, in

class LazyImportModule(ModuleType):

File "/root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/import_utils.py", line 383, in LazyImportModule

AST_INDEX = load_index()

File "/root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/utils/ast_utils.py", line 723, in load_index

_update_index(index, files_mtime)

File "/root/miniconda3/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 "/root/miniconda3/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 "/root/miniconda3/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 /root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/models/multi_modal/prost/dataloaders/rawvideo_util.py, a related error excepted in the file /root/miniconda3/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 /root/miniconda3/envs/cosyvoice/lib/python3.8/site-packages/modelscope/models/multi_modal/prost/dataloaders/rawvideo_util.py to see whether the file is correctly edited.

Solution


Solution

Try to use conda to install all required Python packages.