Repository navigation
Conversation
… timestamps mel and diarization streaming now realize the weights before taking a tensor pointer. On a device backend realizing swaps in device tensors and frees the host context, so the pointer dangled and `parakeet-cli transcribe --stream` crashed on CUDA with every model. mudler#40 stripped language tags such as <en-US> from the offline text only. The streaming session now leaves them out of the streamed text and the word tokens, and group_words() drops them with the lone `▁` piece the model emits before each tag, so they no longer show up as words in offline or streaming timestamps. detokenize() no longer emits two spaces in a row, which that `▁` left behind once the tag was stripped. test_stream_special_pieces checks detokenize() and group_words() without a model. AGENTS.md and docs/capi.md say the streamed text drops language tags as well as <EOU>/<EOB>.
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.
Problem
Three things go wrong with Nemotron 3.5 ASR streaming on master (
4fbf4d9):--streamcrashes on CUDA.parakeet-cli transcribe --streamstops right after the backend starts, with an access violation(
0xC0000005on Windows). It happens with every model file I tried, includingnemotron-3.5-asr-streaming-0.6b-q8_0.ggufand-q6_k.gguffrom mudler/parakeet-cpp-gguf.MelKerneltakes a tensor pointer beforeensure_weights_realized(). On a device backend,realizing swaps the name-to-tensor map to device tensors and frees the host context, so the pointer dangles.
StreamingDiarizationhas the same order forlearnable_sil_emb: it takes the tensor, then realizes.MelKernelread, and saysModel::loadrealizes the weights first. The--streampathstill crashes on master, and realizing inside
MelKernelfixes it.<en-US>) in transcript text #40 removed the tags from the offline text. The streaming session still appends them, so the streamed text has<en-US>after every sentence.5.76-5.84 <en-US> (1.00).launch. We're.Fix
mel.cpp: realize the weights before taking any tensor pointer.diarization_streaming.cpp: move the existingensure_weights_realized()call beforeml.tensor(...).tokenizer:is_special_piece()is factored out ofstrip_special_tokens(), with the same rule (<...>or[...]);detokenize()no longer emits two spaces in a row.StreamingSession: special pieces no longer go into the streamed text or the word tokens.group_words(): drops special pieces, and the bare space piece right before one, so a tag never becomes a word.This covers offline and streaming.
AGENTS.md(the test list and the streaming semantics) anddocs/capi.mdnow say the streamed text dropslanguage tags as well as
<EOU>/<EOB>.Text without tags or double spaces comes out unchanged.
Measurement
Setup:
4fbf4d9, Release, Windows 11, MSVC. One CUDA 12.8 build (sm_86) and one CPU (AVX2) build.nemotron-3.5-asr-streaming-0.6b-q8_0.ggufand-q6_k.gguffrom mudler/parakeet-cpp-gguf at741158a.--lang en-US.CUDA build, 20 clips:
--streamruns that crash, q8_0 / q6_k--streamWER, q8_0 / q6_k--stream:<en-US>tags in the textNotes:
clips for both models.
<en-US>tags in 10 clips.
Tests
New
test_stream_special_pieces, which needs no model. It checks two things:detokenize()must not double the space a removed tag leaves;group_words()must not turn a tag, or the space piece before it, into a word.On master it fails with
text 'The sun. It', expected 'The sun. It'andwords 'The|sun.|<en-US>|It', expected 'The|sun.|It'. It passes with this change.ctest -LE modelon the CPU build (CED and voice-detect off): 51 of 54 pass, includingtest_special_token_filter. The other three fail the same way on master; they are Windows issues these filesdon't touch:
test_backend_deviceandtest_bundledon't compile with MSVC (setenv,unistd.h);test_audio_iostops with a numerical exception.The model tests were not run. The CLI runs above cover the streaming and offline paths with real models.
Limits
test_streaming_eou_resetwas not run: it needs the realtime EOU model and its NeMo baseline.<EOU>/<EOB>handling as it is.detokenize()now never emits two spaces in a row, and that rule applies to that model's text too.