Skip to content

Commit

Permalink
Fix the normalized_text in LibriTTS recipe (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu-han authored Dec 5, 2024
1 parent a1ade8e commit bdd0f85
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions egs/libritts/TTS/local/prepare_tokens_libritts.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@
from tqdm.auto import tqdm


def remove_punc_to_upper(text: str) -> str:
text = text.replace("‘", "'")
text = text.replace("’", "'")
tokens = set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'")
s_list = [x.upper() if x in tokens else " " for x in text]
s = " ".join("".join(s_list).split()).strip()
return s


def prepare_tokens_libritts():
output_dir = Path("data/spectrogram")
prefix = "libritts"
Expand Down Expand Up @@ -72,7 +63,7 @@ def prepare_tokens_libritts():
for t in tokens_list:
tokens.extend(t)
cut.tokens = tokens
cut.supervisions[0].normalized_text = remove_punc_to_upper(text)
cut.supervisions[0].normalized_text = text

new_cuts.append(cut)

Expand Down

0 comments on commit bdd0f85

Please sign in to comment.