ranchlai/mandarin-tts

Key Error when feeding bilingual text

Opened this issue · 0 comments

Hi, thanks for your great work! I met the following problem:

python synthesize.py --input="大家好,Transformer是Google提出的一种神经网络架构"
Failed to open text file 大家好,Transformer是Google提出的一种神经网络架构
Treating input as text
Namespace(channel=2, duration=1.0, input='大家好,Transformer是Google提出的一种神经网络架构', output_dir='./outputs/')
loading model from ./checkpoint/checkpoint_500000.pth
loading waveglow...
processing 大家好,Transformer是Google提出的一种神经网络架构
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.609 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
  File "synthesize.py", line 152, in <module>
    cn_sentence_seq,cn_sentence_aug = utils.convert_cn(cn_sentence)
  File "/content/mandarin-tts/utils/hz_utils.py", line 100, in convert_cn
    cn_array = np.array([[cn2idx[c] for c in cn_sentence]])
  File "/content/mandarin-tts/utils/hz_utils.py", line 100, in <listcomp>
    cn_array = np.array([[cn2idx[c] for c in cn_sentence]])
KeyError: 'T'