Repository navigation
fix(onnx): handle empty and short inputs in offline VAD - #3846
Merged
Merged
Conversation
2 of 3 tasks
LauraGPT
reviewed
Nov 6, 2026
LauraGPT
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed both changed files at f2dfafb3848b19e13eae5e1a9f51bb682903c40e against current main 57485f744e445898cdba06d0868468bcc5086f5d. The zero-frame check uses the actual frontend length, preserves an empty independent result at each short-input position, and leaves normal LFR/scoring unchanged. The feature shape and dtype are preserved when bypassing LFR.
Maintainer validation:
- The submitted short-input regression fails on unchanged main; the failure log is retained.
- 77 selected installed-wheel CPU/package tests pass on the combined current-main tree.
- 87 newly executed L20Z/CUDA FP32 cases pass: empty/sub-frame/boundary audio, paths/arrays, mixed file lists, requested batch sizes 1/2/3 (effective batch 1), exact result ownership and inference-call counts. Actual profiles contain CUDA nodes and no CPU node fallback. This uses the existing analytic ONNX scoring/cache fixture plus real wrapper/frontend/VAD state machine, not pretrained weights or ASR-quality/full-suite validation.
- Exact-head CI logs and downloaded wheel/sdist/runtime artifacts were inspected, including actual package source bytes and source-commit markers. No CI rerun.
This is a source fix. Existing published funasr-onnx 0.4.8 is not overwritten; package delivery requires a new version. No protection bypass or approval-policy change.
LauraGPT
added a commit
that referenced
this pull request
Nov 6, 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
Offline
Fsmn_vadcrashes on empty audio or recordings shorter than one analysis window. The frontend produces no feature frames, but LFR still reads the first frame, raisingIndexError. In a file list, this also interrupts processing of the remaining files.Check the actual fbank frame count before applying LFR. For zero-frame inputs, return correctly shaped empty features and skip inference. Each input keeps its empty segment list, and processing continues with the next file.
Type of change
Validation
Extended the existing offline VAD tests to cover empty/short inputs, analysis-window boundaries and mixed short/normal file lists. Tests verify result order, unchanged normal-audio segments and no inference calls for zero-frame inputs.
Offline/streaming VAD regressions and installed-package checks pass. Tests use the real frontend and VAD state machine with mocked neural inference.
python -m compileall funasr examples testsUser impact
Empty or very short recordings return an empty segment list instead of aborting the call, including when mixed with normal recordings.
Notes for reviewers
The check follows the frontend configuration rather than a fixed sample count. Changes are limited to offline
Fsmn_vadand its existing tests; the shared frontend and streaming VAD are unchanged.