Repository navigation
fix(cli): give single-row TSV output the real time span - #3750
Closed
Arthur031221 wants to merge 1 commit into
Closed
Arthur031221 wants to merge 1 commit into
Arthur031221 wants to merge 1 commit into
Conversation
When a result has no sentence_info, -f tsv wrote 0.000 as both start and end, while -f srt already spans the token timestamps or the audio length. Share that span between the two formats.
LauraGPT
reviewed
Oct 1, 2026
LauraGPT
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed e3a2821d489f5aa646139dfafd3b8ff415ce1cfb against its parent 4a84879ae8ca4d2430953b11c49d609217d93988. No actionable correctness findings in this change.
Independent CPU validation using the same complete tests/test_cli.py from this PR:
- Parent: 28 passed, 1 failed. The new TSV regression reproduces the incorrect
0.000 -> 0.000bounds. - PR head: 29 passed, 0 skipped/errors.
- Additional 14 boundary cases (26 assertions) passed: token bounds, dictionary/unsorted timestamps, actual WAV-duration fallback, unreadable audio, empty/unusable timestamps, unchanged sentence-segment output, and byte-equivalent SRT output.
The shared fallback preserves the existing SRT behavior while giving the single TSV row the available time span. Validation used model doubles at the existing test boundary; no real-model inference or full-repository test claim.
Commit metadata note: this head is unsigned and has no Signed-off-by trailer. This is a comment-only technical review, not a merge-policy approval.
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
funasr FILE -f tsvwrites0.000as both start and end of its only row when the result has no sentence-level timestamps (an empty or missingsentence_info).-f srtalready handles that case by spanning the token timestamps, or the audio length if there are none. This change moves that span logic into one helper,_fallback_bounds_ms, and uses it for both formats. SRT output is unchanged.Type of change
Validation
python -m compileall funasr/cli.py tests/test_cli.py: passes.pytest tests/test_cli.py: 29 passed. Withfunasr/cli.pyrestored to the base commit, the new TSV test fails (0.000 0.000 hello worldinstead of0.300 1.700 hello world) and the other 28 pass.AutoModelreturningsentence_info: []and token timestamps[[300, 800], [900, 1700]]. I did not run a real model.User impact
Anyone running
funasr audio.wav -m fun-asr-nano -f tsvgot the whole transcript on one row timed0.000to0.000. Thefun-asr-nanoentry inMODEL_CONFIGShas no punctuation model and the CLI does not add one for it, so with token timestamps presentinference_with_vadsetssentence_infoto[](the "punc_model is required for sentence_timestamp" warning branch). I confirmed that branch by readingauto_model.pyand by drivinginference_with_vadwith stubs, not with the real model.Notes for reviewers
0to the audio duration, or0to0if the duration cannot be read. SRT already does the same.