Skip to content

fix(runtime): handle streaming Paraformer chunks without features - #3827

Merged
LauraGPT merged 1 commit into
mainfrom
codex/fix-onnx-paraformer-short-chunks-20261102
Nov 2, 2026
Merged

LauraGPT merged 1 commit into
mainfrom
codex/fix-onnx-paraformer-short-chunks-20261102

Conversation

@LauraGPT

@LauraGPT LauraGPT commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Streaming Paraformer currently reads feats.shape[1] even when the real
online frontend returns a one-dimensional empty array before its first LFR
frame. This raises IndexError for short initial packets and no-feature calls.
This was explicitly left outside the VAD fix in #3822.

  • Check feature presence with feats.size without changing the nonempty path.
  • Keep frontend audio accumulation/reset and the existing cached-final flush.
  • Add seven regression methods to the already-run standalone ONNX test file.

Validation

  • Current-main red reproduction: 5 failing / 7 passing test methods;
    all five failures were IndexError: tuple index out of range.
  • Candidate wheel built from sdist, twine metadata and private install verified;
    all 71 related package/rich-transcription tests pass, no skips.
  • Real NVIDIA L20Z / ONNX Runtime GPU1.23.2, NumPy1.26.4, kaldi-native-fbank1.22.3:
    32 new boundary scenarios, baseline25IndexErrors/7passes to candidate32passes.
    The seven existing successful scenarios retain identical outputs and cache
    fingerprints. Candidate encoder/decoder profiles contain162CUDA node events
    and noCPU node events.
  • FP32,batch1,16kHz,chunks[5,10,5], deterministic silence/sine inputs; reused
    hash-verified synthetic ONNX encoder/decoder graphs, actual frontend/CIF/cache/
    decode/result path. This is runtime contract validation, not pretrained ASR
    accuracy, full repository-suite coverage, BF16, or leaderboard validation
    .
  • Coverage includes first packets0/1/160/320/399/400/480/560/879samples, repeated
    160-sample accumulation, empty final after buffered features, existing-cache
    final/nonfinal empty calls, stream reuse, and880/960/9600-sample controls.

Only two files change. No model downloads, shared environment changes, package
version bump, release, or PyPI upload. Published0.4.4 does not yet contain this
new repair; this PR is a source fix for the next standalone package.

Preserve frontend accumulation and terminal cache flushing for short packets.

Signed-off-by: LauraGPT <zhifu.gzf@alibaba-inc.com>
@LauraGPT
LauraGPT merged commit 7eae5ba into main Nov 2, 2026
4 checks passed
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.

1 participant