Skip to content

Commit 263ed6a

Browse files
authored
Fix reading file encoding with UTF-8 (#130)
1 parent ada1779 commit 263ed6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/tts_mlx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def main():
131131
print("Enter text to synthesize (Ctrl+D to end input):")
132132
text_to_tts = sys.stdin.read().strip()
133133
else:
134-
with open(args.inp, "r") as fobj:
134+
with open(args.inp, "r", encoding="utf-8") as fobj:
135135
text_to_tts = fobj.read().strip()
136136

137137
all_entries = [tts_model.prepare_script([text_to_tts])]

scripts/tts_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def main():
6363
print("Enter text to synthesize (Ctrl+D to end input):")
6464
text = sys.stdin.read().strip()
6565
else:
66-
with open(args.inp, "r") as fobj:
66+
with open(args.inp, "r", encoding="utf-8") as fobj:
6767
text = fobj.read().strip()
6868

6969
# If you want to make a dialog, you can pass more than one turn [text_speaker_1, text_speaker_2, text_2_speaker_1, ...]

0 commit comments

Comments
 (0)