High-Quality Voice Cloning TTS for 600+ Languages
Python
replace Chinese parentheses with English ones in text
Han Zhu31b8a4d8b7c5
diff --git a/omnivoice/models/omnivoice.py b/omnivoice/models/omnivoice.pyindex 3d0b20e..3306e2c 100644--- a/omnivoice/models/omnivoice.py+++ b/omnivoice/models/omnivoice.py@@ -1560,6 +1560,9 @@ def _combine_text(text, ref_text: Optional[str] = None) -> str:# filter out newline / carriage-return charactersfull_text = re.sub(r"[\r\n]+", "", full_text)+ # replace Chinese parentheses with English ones+ full_text = full_text.replace("\uff08", "(").replace("\uff09", ")")+# collapse consecutive spaces / tabs into a single spacefull_text = re.sub(r"[ \t]+", " ", full_text)