From 319378e0011b81d075d6a2b1257228c61494b860 Mon Sep 17 00:00:00 2001 From: Justin John Date: Tue, 23 Jul 2024 16:43:52 +0530 Subject: [PATCH] Fix UnicodeDecodeError by specifying UTF-8 encoding when reading text files --- tts/GPT-SoVITS/fakeyou_infer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tts/GPT-SoVITS/fakeyou_infer.py b/tts/GPT-SoVITS/fakeyou_infer.py index 92b2cf2..702b370 100644 --- a/tts/GPT-SoVITS/fakeyou_infer.py +++ b/tts/GPT-SoVITS/fakeyou_infer.py @@ -572,10 +572,10 @@ def main(): prompt_text = None if args.ref_text and os.path.exists(args.ref_text): - with open(args.ref_text, 'r') as f: + with open(args.ref_text, 'r', encoding='utf-8') as f: prompt_text = f.read().strip() - with open(args.target_text, 'r') as f: + with open(args.target_text, 'r', encoding='utf-8') as f: target_text = f.read().strip() output_path = gptsovits_inference(