From 6d82050b9cce3cd42c573b2179975a25ab5467af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=82=A6?= Date: Wed, 30 Oct 2024 16:38:05 +0800 Subject: [PATCH] add encoding (#1730) --- GPT_SoVITS/text/g2pw/g2pw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPT_SoVITS/text/g2pw/g2pw.py b/GPT_SoVITS/text/g2pw/g2pw.py index a91bc11..1e3738a 100644 --- a/GPT_SoVITS/text/g2pw/g2pw.py +++ b/GPT_SoVITS/text/g2pw/g2pw.py @@ -127,14 +127,14 @@ def get_dict(): def read_dict(): polyphonic_dict = {} - with open(PP_DICT_PATH) as f: + with open(PP_DICT_PATH,encoding="utf-8") as f: line = f.readline() while line: key, value_str = line.split(':') value = eval(value_str.strip()) polyphonic_dict[key.strip()] = value line = f.readline() - with open(PP_FIX_DICT_PATH) as f: + with open(PP_FIX_DICT_PATH,encoding="utf-8") as f: line = f.readline() while line: key, value_str = line.split(':') @@ -151,4 +151,4 @@ def correct_pronunciation(word,word_pinyins): return word_pinyins -pp_dict = get_dict() \ No newline at end of file +pp_dict = get_dict()