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.63k stars 710 forks source link

运行25Hz报错 #456

Closed HUIZI66889 closed 2 months ago

HUIZI66889 commented 2 months ago

报错信息如下:

(robot_clone) E:\yanjiuyuan\robot\Cosyvoice>python main_test.py 2024-09-30 10:33:51,776 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found. 2024-09-30 10:33:51,778 - modelscope - INFO - Loading ast index from C:\Users\Administrator.cache\modelscope\ast_indexer 2024-09-30 10:33:51,889 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 16066b37e1484529497a75230652add4 and a total number of 980 components indexed failed to import ttsfrd, use WeTextProcessing instead D:\software_download\anaconda\envs\robot_clone\lib\site-packages\diffusers\models\lora.py:393: FutureWarning: LoRACompatibleLinear is deprecated and will be removed in version 1.0.0. Use of LoRACompatibleLinear is deprecated. Please switch to PEFT backend by installing PEFT: pip install peft. deprecate("LoRACompatibleLinear", "1.0.0", deprecation_message) 2024-09-30 10:33:56,454 INFO input frame rate=25 Traceback (most recent call last): File "E:\yanjiuyuan\robot\Cosyvoice\main_test.py", line 12, in cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M-25Hz') # or change to pretrained_models/CosyVoice-300M for 50Hz inference File "E:\yanjiuyuan\robot\Cosyvoice\cosyvoice\cli\cosyvoice.py", line 32, in init configs = load_hyperpyyaml(f) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\hyperpyyaml\core.py", line 188, in load_hyperpyyaml hparams = yaml.load(yaml_stream, Loader=loader) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\yaml__init__.py", line 81, in load return loader.get_single_data() File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 116, in get_single_data return self.construct_document(node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 120, in construct_document data = self.construct_object(node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object data = self.construct_non_recursive_object(node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 188, in construct_non_recursive_object for _dummy in generator: File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 633, in construct_yaml_map value = self.construct_mapping(node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 429, in construct_mapping return BaseConstructor.construct_mapping(self, node, deep=deep) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 244, in construct_mapping value = self.construct_object(value_node, deep=deep) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 147, in construct_object data = self.construct_non_recursive_object(node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\ruamel\yaml\constructor.py", line 183, in construct_non_recursive_object data = constructor(self, tag_suffix, node) File "D:\software_download\anaconda\envs\robot_clone\lib\site-packages\hyperpyyaml\core.py", line 491, in _construct_name raise ImportError("There is no such entity as %s" % callable_string) ImportError: There is no such entity as cosyvoice.tokenizer.tokenizer.get_tokenizer

相关代码如下:

from cosyvoice.cli.cosyvoice import CosyVoice from cosyvoice.utils.file_utils import load_wav import torchaudio import os, sys sys.path.insert(0, os.path.abspath('third_party/Matcha-TTS')) import time

start_time = time.time() cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M-25Hz') # or change to pretrained_models/CosyVoice-300M for 50Hz inference

zero_shot usage, <|zh|><|en|><|jp|><|yue|><|ko|> for Chinese/English/Japanese/Cantonese/Korean

prompt_speech_16k = load_wav('zero_shot_prompt.wav', 16000) for i, j in enumerate(cosyvoice.inference_zero_shot('收到好友从远方寄来的生日礼物,那份意外的惊喜与深深的祝福让我心中充满了甜蜜的快乐,笑容如花儿般绽放。', '希望你以后能够做的比我还好呦。', prompt_speech_16k, stream=False)): torchaudio.save('zeroshot{}.wav'.format(i), j['tts_speech'], 22050)

print("总共用时:", time.time()-start_time)

请问该报错要如何解决呢?

HUIZI66889 commented 2 months ago

解决了,没有拉取最新的仓库