diff --git a/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py b/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py index 283e91c3..3ca1399b 100644 --- a/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py +++ b/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py @@ -31,7 +31,7 @@ def get_first(text: str) -> str: return text -def merge_short_text_in_array(texts: str, threshold: int) -> list: +def merge_short_text_in_array(texts: List[str], threshold: int) -> list: if (len(texts)) < 2: return texts result = [] diff --git a/GPT_SoVITS/text/chinese.py b/GPT_SoVITS/text/chinese.py index 944c9cb7..271dbf04 100644 --- a/GPT_SoVITS/text/chinese.py +++ b/GPT_SoVITS/text/chinese.py @@ -13,7 +13,7 @@ normalizer = lambda x: cn2an.transform(x, "an2cn") current_file_path = os.path.dirname(__file__) pinyin_to_symbol_map = { line.split("\t")[0]: line.strip().split("\t")[1] - for line in open(os.path.join(current_file_path, "opencpop-strict.txt")).readlines() + for line in open(os.path.join(current_file_path, "opencpop-strict.txt"), encoding="utf-8").readlines() } import jieba_fast diff --git a/GPT_SoVITS/text/chinese2.py b/GPT_SoVITS/text/chinese2.py index acfebfe2..c076efea 100644 --- a/GPT_SoVITS/text/chinese2.py +++ b/GPT_SoVITS/text/chinese2.py @@ -14,7 +14,7 @@ normalizer = lambda x: cn2an.transform(x, "an2cn") current_file_path = os.path.dirname(__file__) pinyin_to_symbol_map = { line.split("\t")[0]: line.strip().split("\t")[1] - for line in open(os.path.join(current_file_path, "opencpop-strict.txt")).readlines() + for line in open(os.path.join(current_file_path, "opencpop-strict.txt"), encoding="utf-8").readlines() } import jieba_fast