[TTS] Map Korean to korean_chartokenizer in LANGUAGE_TOKENIZER_MAP by fjvbn2003 · Pull Request #16396 · NVIDIA-NeMo/Speech · GitHub
Skip to content

[TTS] Map Korean to korean_chartokenizer in LANGUAGE_TOKENIZER_MAP - #16396

Open
fjvbn2003 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fjvbn2003:tts-korean-tokenizer-map
Open

fjvbn2003 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
fjvbn2003:tts-korean-tokenizer-map

Conversation

@fjvbn2003

Copy link
Copy Markdown

What does this PR do ?

Adds a "ko" entry to LANGUAGE_TOKENIZER_MAP so get_tokenizer_for_language("ko", ...) picks the korean_chartokenizer that MagpieTTS v2607 ships, instead of silently falling back to english_phoneme.

Collection: tts

Changelog

  • nemo/collections/tts/parts/utils/tts_dataset_utils.py: add "ko": ["korean_chartokenizer", "korean"] to LANGUAGE_TOKENIZER_MAP.
  • tests/collections/tts/parts/utils/test_tts_dataset_utils.py: two unit tests in TestGetTokenizerForLanguage — Korean resolves to korean_chartokenizer when it is available, and still falls back to the default when a checkpoint has no Korean tokenizer.

Usage

from nemo.collections.tts.parts.utils.tts_dataset_utils import get_tokenizer_for_language

get_tokenizer_for_language("ko", ["english_phoneme", "japanese_phoneme", "korean_chartokenizer"])
# before: 'english_phoneme'   after: 'korean_chartokenizer'

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 default english_phoneme, which drops almost all Hangul: the sentence 처음 뵙겠습니다. 주말은 어떠셨어요? encodes to 5 tokens with english_phoneme and 51 with korean_chartokenizer.

On main, do_tts() first consults the checkpoint's language_to_tokenizer_mapping (#15882), so whether do_tts is 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 no language_to_tokenizer_mapping (and always in the 3.0.0 release, which does not contain Bring MagpieTTS Release Fixes into Main Branch #15882), and
  • ChunkedTTSInferenceDataset._get_tokenizer_name() uses for every manifest entry without tokenizer_names.

What I measured (nemo_toolkit 3.0.0, nvidia/magpie_tts_multilingual_357m branch v2607, 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 with nvidia/nemotron-3.5-asr-streaming-0.6b (ko-KR) and character error rate against the input:

Tokenizer used Audio length Round-trip CER
english_phoneme (what the lookup returns for "ko") 0.4 s / 0.7 s / 0.8 s 1.00 / 1.00 / 1.00
korean_chartokenizer (lookup patched to return it) 3.5 s / 5.8 s / 3.8 s 0.00 / 0.00 / 0.05

The same failure appeared with the main (19806879) and v2602 revisions of the checkpoint on 3.0.0. English, Japanese and Chinese sentences were normal in the same runs.

Checks run

  • git diff --check: clean.
  • The new and existing get_tokenizer_for_language logic, extracted from the file with ast and run against the 15 tokenizer names of the v2607 checkpoint: before the change ko -> english_phoneme, after it ko -> korean_chartokenizer; all other languages unchanged; ko without a Korean tokenizer still returns english_phoneme.
  • Not run: pytest tests/collections/tts/parts/utils/test_tts_dataset_utils.py and pre-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_phoneme through the static map: it (checkpoint has italian_chartokenizer, map expects italian_phoneme), vi (vietnamese_chartokenizer vs vietnamese_phoneme), hi (hindi_phoneme vs hindi_chartokenizer), pt (portuguese_Brazilian_phoneme, no entry) and ar (arabic_{AE,SA,MSA}_chartokenizer, no entry). I only measured Korean, so I kept this PR to ko; 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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation? (No user-facing docs list this map.)
  • Does the PR affect components that are optional to install? (No.)

PR Type:

  • New Feature
  • Bugfix
  • Documentation

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

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>
@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the TTS label Oct 16, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request TTS waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants