Skip to content

fix(crispasr): filter garbage words from parakeet word-level timestamps#10421

Merged
mudler merged 1 commit into
mudler:masterfrom
fqscfqj:fix/crispasr-parakeet-garbage-segments
Jun 21, 2026
Merged

fix(crispasr): filter garbage words from parakeet word-level timestamps#10421
mudler merged 1 commit into
mudler:masterfrom
fqscfqj:fix/crispasr-parakeet-garbage-segments

Conversation

@fqscfqj

@fqscfqj fqscfqj commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Problem

When using parakeet models with word-level timestamps enabled, spurious subtitle entries appear with garbage content:

00:45:33,592 --> 00:45:33,592
parakeet@rH\x0b\ufffdI

This happens because the parakeet-specific word accessors (crispasr_parakeet_result_*) return stale initialisation data — the model name and binary blobs — for segments with no real speech (e.g. trailing silence, pure noise).

Root Cause

The AudioTranscription code falls back to parakeet-specific word functions when CppGetWordCount(i) == 0 && i == 0. These functions return a global word list that may contain initialisation artifacts when no speech was detected. The data was passed through without validation.

Fix

Added isValidWord() filter that rejects words with:

  • Empty/whitespace-only text
  • U+FFFD replacement characters (from binary data scrubbed to valid UTF-8)
  • Negative timestamps
  • Zero duration (end <= start) — the garbage "parakeet" word has start == end == 0

Also skip empty segments entirely when they have no recognisable content (empty text AND no valid words), preventing them from appearing in SRT/VTT output.

Applied to both AudioTranscription and AudioTranscriptionStream.

Testing

Verified on a live deployment (RTX 3090, parakeet-tdt-0.6b-v3-q8_0.gguf):

Test case Before After
Sine wave (no speech) Garbage parakeet@rH\u000b\ufffdI segment Empty output ✅
Real speech (6.4s English) Clean (words correct) Clean ✅
SRT format Garbage line mixed in Clean ✅

The parakeet-specific word accessors can return stale initialisation
data (model name, binary blobs) for segments with no real speech.
Add isValidWord() to filter out words that have:
- empty or whitespace-only text
- U+FFFD replacement characters (from binary data scrubbing)
- negative timestamps
- zero duration (end <= start)

Also skip empty segments entirely when they have no recognisable
content (empty text AND no valid words), preventing spurious subtitle
entries like '00:45:33,592 --> 00:45:33,592 parakeet@rH\u000b\ufffdI'.

Applies to both AudioTranscription and AudioTranscriptionStream.

Signed-off-by: fqscfqj <fqscfqj@outlook.com>
@fqscfqj fqscfqj force-pushed the fix/crispasr-parakeet-garbage-segments branch from 39eb6ba to fa578bc Compare June 21, 2026 09:54
@mudler

mudler commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Thanks @fqscfqj !

@mudler mudler merged commit cf7f957 into mudler:master Jun 21, 2026
1 check passed
@localai-bot localai-bot added the bug Something isn't working label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants