Skip to content

SOTA Open Source TTS

Fix | in text for vits format

Lengyue938787726ccb
diff --git a/fish_speech/utils/file.py b/fish_speech/utils/file.py
index 7838f38..ad45e32 100644
--- a/fish_speech/utils/file.py
+++ b/fish_speech/utils/file.py
@@ -85,7 +85,12 @@ def load_filelist(path: Path | str) -> list[tuple[Path, str, str, str]]:
with open(path, "r", encoding="utf-8") as f:
for line in f.readlines():
- filename, speaker, language, text = line.strip().split("|")
+ splits = line.strip().split("|", maxsplit=3)
+ if len(splits) != 4:
+ logger.warning(f"Invalid line: {line}")
+ continue
+
+ filename, speaker, language, text = splits
file = Path(filename)
language = language.strip().lower()