Skip to content

Commit

Permalink
fix(test): make test happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 6, 2024
1 parent b1e6f5f commit 4dbd5eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/#588.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
sys.path.append(now_dir)

import logging
import re

import ChatTTS

Expand All @@ -31,8 +32,13 @@
params_refine_text=ChatTTS.Chat.RefineTextParams(show_tqdm=False),
)

trimre = re.compile("\\[[\w_]+\\]")
def trim_tags(txt: str) -> str:
global trimre
return trimre.sub("", txt)

for i, t in enumerate(refined):
if len(t) > 4 * len(texts[i]):
if len(t) > 4 * len(trim_tags(texts[i])):
fail = True
logger.warning("in: %s, out: %s", texts[i], t)

Expand Down

0 comments on commit 4dbd5eb

Please sign in to comment.