Closed ZeeChao closed 3 months ago
需要补充一下,我把demo中的第5行改成了
cosyvoice = CosyVoice('/workspace/CosyVoice/pretrained_models/CosyVoice-300M-SFT')
不知道上面的问题是否跟这个改动有关系。我之所以这样改是希望可以调用已经下载到本地的模型,而不是每次预测从线上下载模型。如果保持demo中原来的写法,似乎不会出现上面提到的错误
我也有同样的问题,检查了git-lfs,和 protobuf的版本,都没有问题,但仍然会报错
是DEMO上的模型的问题,通过魔搭直接下载模型来跑,是可以加载成功
我按照readme的方法安装搭建环境,下载模型。在运行
unzip resource.zip -d .
时,报错
Archive: resource.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of resource.zip or resource.zip.zip, and cannot find resource.zip.ZIP, period.
然后,我发现resource.zip中的内容是
version https://git-lfs.github.com/spec/v1 oid sha256:a6ac6a63997761ae2997373e2ee1c47040854b4b759ea41ec48e4e42df0f4d73 size 28303423
同时,我还发现,三个模型中的campplus.onnx文件中,写的也是
version https://git-lfs.github.com/spec/v1 oid sha256:a6ac6a63997761ae2997373e2ee1c47040854b4b759ea41ec48e4e42df0f4d73 size 28303423
因此,我在运行readme的demo时,报错
Traceback (most recent call last): File "run.py", line 5, in
cosyvoice = CosyVoice('/workspace/CosyVoice/pretrained_models/CosyVoice-300M-SFT')
File "/workspace/CosyVoice/cosyvoice/cli/cosyvoice.py", line 30, in init
self.frontend = CosyVoiceFrontEnd(configs['get_tokenizer'],
File "/workspace/CosyVoice/cosyvoice/cli/frontend.py", line 49, in init
self.campplus_session = onnxruntime.InferenceSession(campplus_model, sess_options=option, providers=["CPUExecutionProvider"])
File "/opt/conda/envs/tts/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/opt/conda/envs/tts/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 460, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /workspace/CosyVoice/pretrained_models/CosyVoice-300M-SFT/campplus.onnx failed:Protobuf parsing failed.