From d867784d98d0047b8940e833d338dcd0ad04a4d1 Mon Sep 17 00:00:00 2001 From: Anai-Guo Date: Sun, 30 Aug 2026 03:54:30 -0700 Subject: [PATCH] fix(text): pass language/version and unpack clean_text in text_to_sequence text_to_sequence accepted `language` and `version` but forwarded neither: phones = clean_text(text) clean_text is `clean_text(text, language, version=None)`, so this raises TypeError: clean_text() missing 1 required positional argument: 'language'. It also assigned clean_text's whole (phones, word2ph, norm_text) tuple to `phones`, so even with language supplied, cleaned_text_to_sequence would fail with "unhashable type: 'list'" while looking the tuple's elements up in the symbol table. Match the three existing call sites (api.py:523, GPT_SoVITS/inference_webui.py:592, GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py:208), which all do phones, word2ph, norm_text = clean_text(text, language, version) phones = cleaned_text_to_sequence(phones, version) --- GPT_SoVITS/text/cleaner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPT_SoVITS/text/cleaner.py b/GPT_SoVITS/text/cleaner.py index 7ba8f376..79eb0689 100644 --- a/GPT_SoVITS/text/cleaner.py +++ b/GPT_SoVITS/text/cleaner.py @@ -86,7 +86,7 @@ def text_to_sequence(text, language, version=None): version = os.environ.get("version", version) if version is None: version = "v2" - phones = clean_text(text) + phones, _, _ = clean_text(text, language, version) return cleaned_text_to_sequence(phones, version)