Repository navigation
nemotron_transcribe: normalize regional language hints - #1190
Merged
0xShug0 merged 1 commit intoNov 3, 2026
Merged
Conversation
Resolve common regional language tags and aliases to the reference language names while preserving custom names, unknown values and existing instruction defaults. Add policy regressions and clarify language-hint and speaker-format behavior. Refs 0xShug0#1180. AI-Assisted-By: Codex (OpenAI)
Owner
|
@JarodMica PR merged! Thanks! |
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.
language=zh-CNpreviously reached the built-in instruction as "The speech is in zh-CN." This now resolves to "The speech is in Chinese.", matchinglanguage=zhand the reference runtime's regional-tag lookup.Normalize ASCII whitespace, case and underscore aliases for short and two-component tags, include the reference's language names, and preserve existing custom-name/unknown-tag fallback. Add regression cases and clarify language-hint and speaker-punctuation behavior in the model guide. Existing option names,
auto, default instructions and custom-instruction precedence are unchanged.Why this normalization
The purpose is compatibility with NVIDIA's existing prompt-construction policy. In the official NeMo-Speech.cpp reference,
language_nameexplicitly maps a BCP-47 primary subtag to a language name after handling case, whitespace and underscore aliases. Itslanguage_hintthen constructs the sentence "The speech is in Chinese." for a recognized Chinese tag.An executable check against the official implementation confirmed that
zh-CN, literalzh-CH,ZH_chandzhall resolve toChinese, matching this patch. The reference looks up the primaryzhsubtag; it does not validate the regional suffix in this lookup.This is scoped to language labels used in generated instructions, including built-in translation target names. It does not normalize recognized transcript text or replace caller-supplied instructions. Existing free-form names and unknown values retain their prior fallback behavior. The goal is to follow a demonstrated reference behavior, rather than introduce a general input-normalization policy.
Validation: Windows CUDA CLI/server builds and seven focused CTests pass. Paired CUDA HTTP checks confirmed identical output for
zh-CNandzhafter the fix, unchanged English/Japanese controls, stable repeated requests and matched CLI/server transcripts.Refs #1180. This addresses language-tag handling only. It does not resolve or close the long-clip translation issue, which also reproduced in an independent BF16 runtime.