Repository navigation
fix(frontend): handle default no-LFR online features - #3849
Merged
Merged
Conversation
Handle default online frontend features without an unbound cursor and finalize the last nonempty offline VAD chunk. Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
Merged
LauraGPT
added a commit
that referenced
this pull request
Nov 7, 2026
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.
Summary
Fix the default
WavFrontendOnline(lfr_m=1, lfr_n=1)path, which references an uninitializedlfr_splice_frame_idxafter skipping LFR. Initialize the consumed-frame cursor from the actual per-item feature length, including zero-length items; the LFR branch continues to replace it with its existing splice cursor.Real GPU integration exposed a second issue: final offline audio whose length is an exact multiple of the VAD chunk size gets an unnecessary empty chunk. With no LFR right-context frames, that empty call cannot finalize the last score and can discard a pending dynamic-VAD segment. Mark the last nonempty offline chunk final by adding a remainder chunk only when one exists.
Add 42 regressions covering valid lengths, padding, CMVN, packetization, empty frontend flushes, short inputs, and offline finalization with no-LFR/LFR controls. Run them in the existing KWS/frontend workflow and include the VAD model in its path filters.
Validation
UnboundLocalErrorfailures and 6 passing short-input controls.Scope
No model weights, dependencies, release versions, repository protections, or production configuration change. The generic explicit streaming-empty-input early-return path is unchanged; this PR does not claim to solve every empty-EOS or short-tail case. Root 1.4.22 is already published and does not contain this candidate. The ONNX offline VAD work in #3846 is separate.
Type Of Change