jianchang512 / ChatTTS-ui

一个简单的本地网页界面,使用ChatTTS将文字合成为语音,同时支持对外提供API接口。A simple native web interface that uses ChatTTS to synthesize text into speech, along with support for external API interfaces.
https://pyvideotrans.com
Other
5.98k stars 687 forks source link

选用0.89版本时加载模型报错 #125

Closed decajcd closed 3 months ago

decajcd commented 3 months ago

gpt.load_state_dict(torch.load(gpt_ckpt_path, map_location='cpu')) File "/opt/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for GPT_warpper: Missing key(s) in state_dict: "head_text.weight_g", "head_text.weight_v", "head_code.0.weight_g", "head_code.0.weight_v", "head_code.1.weight_g", "head_code.1.weight_v", "head_code.2.weight_g", "head_code.2.weight_v", "head_code.3.weight_g", "head_code.3.weight_v". Unexpected key(s) in state_dict: "head_text.parametrizations.weight.original0", "head_text.parametrizations.weight.original1", "head_code.0.parametrizations.weight.original0", "head_code.0.parametrizations.weight.original1", "head_code.1.parametrizations.weight.original0", "head_code.1.parametrizations.weight.original1", "head_code.2.parametrizations.weight.original0", "head_code.2.parametrizations.weight.original1", "head_code.3.parametrizations.weight.original0", "head_code.3.parametrizations.weight.original1".

jianchang512 commented 3 months ago
  1. 使用python3.10
  2. torch使用2.20
decajcd commented 3 months ago
  1. 使用python3.10
  2. torch使用2.20

解决了感谢。请问长文本下如何保持整段的音色一致呢,看结果好像是将长文本拆成短文本生成音频后再整合在一起的

jianchang512 commented 3 months ago

多分行

decajcd commented 3 months ago

多分行

每句话限制多少字呢,分行了也不行啊,音调音色都会有变化

jianchang512 commented 3 months ago

目前肯定是有变化的,不论怎么处理,只要不是一句话推理完,都会有改变

decajcd commented 3 months ago

目前肯定是有变化的,不论怎么处理,只要不是一句话推理完,都会有改变

加大 uilib/utils.py 里的150 - 200 也不行吗,这两个数字什么各是什么含义呢