Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: in Windows System got UnicodeDecodeError: 'gbk' codec can't decode byte 0xbb in position 461: illegal multibyte sequence #397

Open
Feige-cn opened this issue Feb 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Feige-cn
Copy link

Describe the bug

./models/tts/maskgct/g2p\sources\g2p_chinese_model\poly_bert_model.onnx
C:\Users\H\anaconda3\envs\maskgct\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:115: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
warnings.warn(
Traceback (most recent call last):
File "d:\MaskGCT\Amphion\local_test.py", line 1, in
from models.tts.maskgct.maskgct_utils import *
File "d:\MaskGCT\Amphion\models\tts\maskgct\maskgct_utils.py", line 20, in
from models.tts.maskgct.g2p.g2p_generation import g2p, chn_eng_g2p
File "d:\MaskGCT\Amphion\models\tts\maskgct\g2p\g2p_generation.py", line 10, in
from models.tts.maskgct.g2p.utils.g2p import phonemizer_g2p
File "d:\MaskGCT\Amphion\models\tts\maskgct\g2p\utils\g2p.py", line 64, in
json_data = f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xbb in position 461: illegal multibyte sequence

How to solve:

json file loading Add encoding= 'utf-8'

Modify the following files:
Models/TTS/maskgct g2p/utils/g2p py line 63
Models/TTS/maskgct/g2p g2p/set py line 28
Models/TTS/maskgct/g2p/g2p_generation py line 117

with open("......", "r", encoding='utf-8') as f:
json_data = f.read()

@Feige-cn Feige-cn added the bug Something isn't working label Feb 18, 2025
@Feige-cn
Copy link
Author

./models/tts/maskgct/g2p\sources\g2p_chinese_model\poly_bert_model.onnx
C:\Users\H\anaconda3\envs\maskgct\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:115: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
warnings.warn(
Error: Could not load the specified mbrola voice file.
Error: Could not load the specified mbrola voice file.
Traceback (most recent call last):
File "d:\MaskGCT\Amphion\local_test.py", line 1, in
from models.tts.maskgct.maskgct_utils import *
File "d:\MaskGCT\Amphion\models\tts\maskgct\maskgct_utils.py", line 20, in
from models.tts.maskgct.g2p.g2p_generation import g2p, chn_eng_g2p
File "d:\MaskGCT\Amphion\models\tts\maskgct\g2p\g2p_generation.py", line 10, in
from models.tts.maskgct.g2p.utils.g2p import phonemizer_g2p
File "d:\MaskGCT\Amphion\models\tts\maskgct\g2p\utils\g2p.py", line 30, in
phonemizer_ja = EspeakBackend(
File "C:\Users\H\anaconda3\envs\maskgct\lib\site-packages\phonemizer\backend\espeak\espeak.py", line 49, in init
self._espeak.set_voice(language)
File "C:\Users\H\anaconda3\envs\maskgct\lib\site-packages\phonemizer\backend\espeak\wrapper.py", line 249, in set_voice
raise RuntimeError( # pragma: nocover
RuntimeError: failed to load voice "ja"

How to solve:

Modify this file: ...{envname}/lib/site-packages/phonemizer/backend/espeak/wrapper.py line 240
if (voice.language not in available) or (voice.language == 'ja'):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant