-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use piper_phonemize as text tokenizer in ljspeech recipe #1511
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
27b1bf4
minor fix of vits/tokenizer.py
yaozengwei ff6784d
minor fix of vits/tokenizer.py
yaozengwei 2cf5891
use piper_phonemize as text tokenizer in ljspeech recipe
yaozengwei e774912
Merge branch 'master' of github.com:k2-fsa/icefall into update-vits-t…
yaozengwei cb04833
remove extra tokens
yaozengwei 1851443
minor updates
yaozengwei 595d4a3
modify usage of tokenizer in vits/train.py
yaozengwei ae83d80
minor updates related to the tokenizer change
yaozengwei 956e58f
update docs
yaozengwei 1d66426
update huggingface link
yaozengwei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,9 @@ | |
import logging | ||
from pathlib import Path | ||
|
||
import g2p_en | ||
import tacotron_cleaner.cleaners | ||
from lhotse import CutSet, load_manifest | ||
from piper_phonemize import phonemize_espeak | ||
|
||
|
||
def prepare_tokens_ljspeech(): | ||
|
@@ -35,17 +35,20 @@ def prepare_tokens_ljspeech(): | |
partition = "all" | ||
|
||
cut_set = load_manifest(output_dir / f"{prefix}_cuts_{partition}.{suffix}") | ||
g2p = g2p_en.G2p() | ||
|
||
new_cuts = [] | ||
for cut in cut_set: | ||
# Each cut only contains one supervision | ||
assert len(cut.supervisions) == 1, len(cut.supervisions) | ||
assert len(cut.supervisions) == 1, (len(cut.supervisions), cut) | ||
text = cut.supervisions[0].normalized_text | ||
# Text normalization | ||
text = tacotron_cleaner.cleaners.custom_english_cleaners(text) | ||
# Convert to phonemes | ||
cut.tokens = g2p(text) | ||
tokens_list = phonemize_espeak(text, "en-us") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At line 42
Please use assert len(cut.supervisions) == 1, (len(cut.supervisions), cut) It is helpful to print the problematic cut on error. |
||
tokens = [] | ||
for t in tokens_list: | ||
tokens.extend(t) | ||
cut.tokens = tokens | ||
new_cuts.append(cut) | ||
|
||
new_cut_set = CutSet.from_cuts(new_cuts) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copyright should be 2023-2024.