Conversation
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
Vanilla Paraformer passes CIF peaks as
us_alphasand alpha weights asus_peakstots_prediction_lfr6_standard(). This makes the helper search for boundary crossings in alpha weights and, when the boundary count does not match, normalize the CIF peak trajectory as though it were alpha weights. It can silently return the expected number of segments with incorrect boundaries.The predictor returns
(acoustic_embeds, token_num, alphas, cif_peak), while the helper expects(us_alphas, us_peaks, char_list). The reversed call was introduced in ce6b70e and is present at the base revision 615ef05.us_alphas,us_peaks, andchar_listkeyword arguments.upsample_rate=1.Paraformer.inference()with the real CIF implementation, timestamp helper, and text postprocessing, while stubbing encoder/predictor/decoder outputs. Cover both sufficient boundary counts and alpha-normalization fallback, with and without a VAD offset.For the synthetic fallback fixture, the same CIF outputs produce:
[[329, 690], [690, 1080]][[90, 510], [510, 1080]]Both return two segments without raising an exception. Fallback itself is legitimate when a token sequence needs an additional boundary; the defect is feeding it the wrong trajectory.
Type of change
Validation
Both sides use the same local environment: macOS 26.5.1 arm64, CPU.
Source baseline:
615ef059c989fca12a546505abb22c5c5b6f329b.Fix commit:
cbce0a2ca1bf8813fa41e3edde7e05fc2b7bbc90.The version string remains
1.4.15on both source revisions; this is not a comparison between two PyPI package releases.python -m compileall -q funasr examples testsgit diff --checkThe local test run emits one urllib3/LibreSSL environment warning. No real checkpoint/audio alignment accuracy claim is made by these synthetic tests.
Real-audio comparison
Tested
clean_0005_0014_output.wav, a sample audio clip (22.8 s, mono, 24 kHz; resampled by FunASR to 16 kHz). SHA-256:f7ac517fa30531430af4d43650e9d2905df07e53ad4c01b1ee0f251f1b457461.The vanilla checkpoint was
iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch, with model-weight SHA-2565bba782a5e9196166233b9ab12ba04cadff9ef9212b4ff6153ed9290ff679025. Both real-audio runs used the fixed checkout: the before run replayed the old behavior by swapping only the helper's alpha/peak arguments, while the after run used the corrected order. Captured alpha tensors, peak tensors, and token inputs were exactly equal between the two runs in each configuration; the 84-token transcripts were unchanged. This isolates the caller change rather than comparing separately installed package versions.batch_size_s=300With VAD enabled, token #57 (zero-based),
虽, starts at 11.690 s before the fix and 17.990 s after it. These are measured timestamp changes, not errors measured against human alignment labels.Input audio: clean_0005_0014_output.wav
Before text is above the waveform; after text is below it. Both rows use the actual output timestamps (vanilla + FSMN-VAD).
Download per-token comparison results, exact environment, and reproduction script. Reproduction instructions and checkpoint revisions are provided with the evidence. These attachments are hosted on the contributor fork; no audio or model files are included in the code diff.
User impact
Corrects timestamp generation for vanilla Paraformer when timestamps are requested. The helper API and transcription path with timestamps disabled are unchanged.
Notes for reviewers
Scope is limited to vanilla Paraformer. E-Paraformer has a similar reversed call, but
PifPredictorreturnscif_peak=None; timestamp support for that path requires separate handling.