Fix UnicodeDecodeError by specifying UTF-8 encoding when reading text files

This commit is contained in:
Justin John
2024-07-23 16:43:52 +05:30
parent d8a04130e8
commit 319378e001
+2 -2
View File
@@ -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(