Skip to content

support file-based ASR for nemotron streaming model#885

Open
rui-ren wants to merge 2 commits into
mainfrom
ruiren/add-file-based-support-nemotron-streaming
Open

support file-based ASR for nemotron streaming model#885
rui-ren wants to merge 2 commits into
mainfrom
ruiren/add-file-based-support-nemotron-streaming

Conversation

@rui-ren

@rui-ren rui-ren commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Add file-based Nemotron ASR transcription support in C++ SDK v2

Summary

This PR completes file-based audio transcription support for Nemotron streaming ASR models in  sdk_v2/cpp  by finishing the C++  AudioSession  implementation and aligning behavior with the existing OpenAI-JSON transcription flow.

For more details, please refer to github/copilot-cli#4024 (comment)

What changed

• Implemented/finished Nemotron file transcription path in:

 sdk_v2/cpp/src/inferencing/generative/audio/audio_session.cc 
 sdk_v2/cpp/src/inferencing/generative/audio/audio_session.h 

• Added WAV file parsing for file-based transcription input:
• RIFF/WAVE validation
•  fmt / data  chunk handling with bounds checks
• 16kHz enforcement
• PCM16 and float32 decoding
• Added Nemotron-specific language runtime option mapping ( lang_id ) and temperature handling.
• Fixed decode flow to keep a single generator across incremental audio processing (100ms chunks + flush), which resolves truncated transcription output for file-based runs.

Behavior

• OpenAI-JSON file transcription for Nemotron models now returns full transcript text from WAV input in SDK v2.
• Existing streaming and non-Nemotron paths remain unchanged.

End-to-end scenario covered

• Model alias:  nemotron-3.5-asr-streaming-0.6b 
• Input:  sample-speech-1m-16k.wav 
• Path exercised: JS SDK v2  AudioClient.transcribe(...)  → C++ SDK v2 audio transcription pipeline

Copilot AI review requested due to automatic review settings July 15, 2026 17:13
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Jul 15, 2026 5:13pm

Request Review

@rui-ren rui-ren changed the title Ruiren/add file based support nemotron streaming support file-based ASR for nemotron streaming model Jul 15, 2026
@rui-ren
rui-ren requested a review from skottmckay July 15, 2026 17:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds file-based WAV transcription for Nemotron streaming ASR models in the C++ SDK.

Changes:

  • Routes Nemotron file requests through the streaming processor.
  • Parses 16 kHz PCM16/float32 WAV files with channel downmixing.
  • Adds language mapping, temperature handling, and OpenAI JSON output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
audio_session.h Declares Nemotron transcription and WAV parsing helpers.
audio_session.cc Implements Nemotron inference, decoding, language mapping, and WAV parsing.

int completion_tokens = 0;

auto decode_all_tokens = [&]() {
while (!generator->IsDone() && !original_request.canceled) {
size_t count = std::min(kNemotronSamplesPerChunk, samples.size() - offset);
run_one_pass(processor->Process(samples.data() + offset, count));
}
run_one_pass(processor->Flush());
}
}

auto samples = LoadPcmWavAsFloatSamples(req.filename);
@nenad1002

nenad1002 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Why? Parakeet can execute faster and more accurate file-based transcription. I wouldn't want customers to rely on streaming models for non-streaming scenarios, and we're encouraging them with this.

@rui-ren

rui-ren commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Why? Parakeet can execute faster and more accurate file-based transcription. I wouldn't want customers to rely on streaming models for non-streaming scenarios, and we're encouraging them with this.

This is not a way to encourage them to do file-base transcription with RNNT streaming model, as you can see here,

github/copilot-cli#4024 (comment)

they are using streaming model, however they do file-based transcription and get error raised. IMO, we better to cover this edge case for them, instead of switch models?

What do you think? @sylvanc

@nenad1002

Copy link
Copy Markdown
Contributor

Why? Parakeet can execute faster and more accurate file-based transcription. I wouldn't want customers to rely on streaming models for non-streaming scenarios, and we're encouraging them with this.

This is not a way to encourage them to do file-base transcription with RNNT streaming model, as you can see here,

github/copilot-cli#4024 (comment)

they are using streaming model, however they do file-based transcription and get error raised. IMO, we better to cover this edge case for them, instead of switch models?

What do you think? @sylvanc

Why? Parakeet can execute faster and more accurate file-based transcription. I wouldn't want customers to rely on streaming models for non-streaming scenarios, and we're encouraging them with this.

This is not a way to encourage them to do file-base transcription with RNNT streaming model, as you can see here,

github/copilot-cli#4024 (comment)

they are using streaming model, however they do file-based transcription and get error raised. IMO, we better to cover this edge case for them, instead of switch models?

What do you think? @sylvanc

Hmm, I haven't realized they're using file-based transcription. Ok, but there are better models for this going forward.

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.

3 participants