netease-youdao / EmotiVoice

EmotiVoice 😊: a Multi-Voice and Prompt-Controlled TTS Engine
Apache License 2.0
7.29k stars 623 forks source link

请问一下,新增语音情感,StyleEncoder 模型需要重训练吗?怎么训练这个模型呢? #142

Open wildBigPanda opened 6 months ago

wildBigPanda commented 6 months ago

我看代码模型里面语音情感的维度写死了,目前只有 【普通 生气 开心 惊讶 悲伤 厌恶 恐惧】 这7个维度, 比如要增加 撒娇 ,要怎么改呢?

syq163 commented 6 months ago

Which specific code are you referring to?

wildBigPanda commented 6 months ago
style_encoder = StyleEncoder(config)
model_CKPT = torch.load(config.style_encoder_ckpt, map_location="cpu")
model_ckpt = {}
for key, value in model_CKPT['model'].items():
    new_key = key[7:]
    model_ckpt[new_key] = value
style_encoder.load_state_dict(model_ckpt, strict=False)

这段代码,key=‘emotion_clf.classifier.bias’ 和key = ‘emotion_clf.classifier.weight’ ,只有7个维度的情感类型