netease-youdao / EmotiVoice

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

encode error when open file #33

Closed xinmos closed 10 months ago

xinmos commented 10 months ago

When starting with 'streamlit run demo_page.py', you may encounter the following error: "UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 2: illegal multibyte sequence".

To resolve this issue, it is recommended to change the encoding when opening the file. You can do this by modifying your code as follows: the file path: EmotiVoice/config/joint/config.py

#### Speaker ####
with open(speaker2id_path, encoding='utf-8') as f:
    speakers = [t.strip() for t in f.readlines()]
speaker_n_labels = len(speakers)

image

fengcheche commented 10 months ago

我也遇到这个问题了,改了不起作用呢

fengcheche commented 10 months ago

好像可以了

Javed-ahmed-shanto commented 10 months ago

I think you can find the solution here: https://stackoverflow.com/questions/28165639/unicodedecodeerror-gbk-codec-cant-decode-byte-0x80-in-position-0-illegal-mult

syq163 commented 10 months ago

The bug has already been fixed. Please update and give it a try.