Skip to content

nemotron_transcribe: normalize regional language hints - #1190

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
JarodMica:fix/nemotron-mandarin-investigation
Nov 3, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
JarodMica:fix/nemotron-mandarin-investigation

Conversation

@JarodMica

@JarodMica JarodMica commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

language=zh-CN previously reached the built-in instruction as "The speech is in zh-CN." This now resolves to "The speech is in Chinese.", matching language=zh and 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_name explicitly maps a BCP-47 primary subtag to a language name after handling case, whitespace and underscore aliases. Its language_hint then constructs the sentence "The speech is in Chinese." for a recognized Chinese tag.

An executable check against the official implementation confirmed that zh-CN, literal zh-CH, ZH_ch and zh all resolve to Chinese, matching this patch. The reference looks up the primary zh subtag; 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-CN and zh after 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.

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)
@JarodMica
JarodMica marked this pull request as ready for review November 3, 2026 20:44
@0xShug0
0xShug0 merged commit a6a2f6d into 0xShug0:main Nov 3, 2026
7 checks passed
@0xShug0

0xShug0 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

@JarodMica PR merged! Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants