{{ message }}
Repository navigation
Conversation
MagpieTTS v2607 added Korean and ships a `korean_chartokenizer`, but
LANGUAGE_TOKENIZER_MAP has no "ko" entry, so get_tokenizer_for_language("ko", ...)
silently falls back to `english_phoneme`. Hangul is mostly dropped by that
tokenizer (a 20-character sentence becomes 5 tokens), and the model produces
0.4-0.8 s of audio that an ASR round trip cannot read back.
The static map is what do_tts() uses when the checkpoint config has no
language_to_tokenizer_mapping, and what ChunkedTTSInferenceDataset always uses
for manifest entries without tokenizer_names.
Add the "ko" entry and unit tests for both the new lookup and the unchanged
fallback when a checkpoint has no Korean tokenizer.
Signed-off-by: YoungjuKim <fjvbn2003@gmail.com>
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

What does this PR do ?
Adds a
"ko"entry toLANGUAGE_TOKENIZER_MAPsoget_tokenizer_for_language("ko", ...)picks thekorean_chartokenizerthat MagpieTTS v2607 ships, instead of silently falling back toenglish_phoneme.Collection: tts
Changelog
nemo/collections/tts/parts/utils/tts_dataset_utils.py: add"ko": ["korean_chartokenizer", "korean"]toLANGUAGE_TOKENIZER_MAP.tests/collections/tts/parts/utils/test_tts_dataset_utils.py: two unit tests inTestGetTokenizerForLanguage— Korean resolves tokorean_chartokenizerwhen it is available, and still falls back to the default when a checkpoint has no Korean tokenizer.Usage
Why
The v2607 model card lists Korean among the 12 supported languages, and the checkpoint's aggregated tokenizer contains
korean_chartokenizer. The static map has no"ko"key, so the lookup returns the defaultenglish_phoneme, which drops almost all Hangul: the sentence처음 뵙겠습니다. 주말은 어떠셨어요?encodes to 5 tokens withenglish_phonemeand 51 withkorean_chartokenizer.On
main,do_tts()first consults the checkpoint'slanguage_to_tokenizer_mapping(#15882), so whetherdo_ttsis affected there depends on the checkpoint config, which I did not verify. The static map is still what:do_tts()uses when the config has nolanguage_to_tokenizer_mapping(and always in the 3.0.0 release, which does not contain Bring MagpieTTS Release Fixes into Main Branch #15882), andChunkedTTSInferenceDataset._get_tokenizer_name()uses for every manifest entry withouttokenizer_names.What I measured (nemo_toolkit 3.0.0,
nvidia/magpie_tts_multilingual_357mbranchv2607, a single 8 GB consumer GPU)do_tts(text, language="ko", apply_TN=False, speaker_index=4)on three Korean sentences, then an ASR round trip withnvidia/nemotron-3.5-asr-streaming-0.6b(ko-KR) and character error rate against the input:english_phoneme(what the lookup returns for"ko")korean_chartokenizer(lookup patched to return it)The same failure appeared with the
main(19806879) andv2602revisions of the checkpoint on 3.0.0. English, Japanese and Chinese sentences were normal in the same runs.Checks run
git diff --check: clean.get_tokenizer_for_languagelogic, extracted from the file withastand run against the 15 tokenizer names of the v2607 checkpoint: before the changeko -> english_phoneme, after itko -> korean_chartokenizer; all other languages unchanged;kowithout a Korean tokenizer still returnsenglish_phoneme.pytest tests/collections/tts/parts/utils/test_tts_dataset_utils.pyandpre-commit(I could not install the full NeMo dependency set in my environment). The new lines are within the 119-column limit.Not changed, but noticed
With the v2607 tokenizer names, five more languages also fall back to
english_phonemethrough the static map:it(checkpoint hasitalian_chartokenizer, map expectsitalian_phoneme),vi(vietnamese_chartokenizervsvietnamese_phoneme),hi(hindi_phonemevshindi_chartokenizer),pt(portuguese_Brazilian_phoneme, no entry) andar(arabic_{AE,SA,MSA}_chartokenizer, no entry). I only measured Korean, so I kept this PR toko; I am happy to extend it if you can confirm the intended tokenizer for each (especially which Arabic variant should be the default).GitHub Actions CI
Untrusted PR: needs
/ok to test <head-sha>from a maintainer.Before your PR is "Ready for review"
Pre checks:
PR Type:
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Additional Information
This change was drafted with AI assistance and reviewed by me.
🤖 Generated with Claude Code
🤖 Generated with Claude Code