Skip to content

fix(stt): thread confidence thresholds into faster-whisper's own gate (salvage #74193) - #77516

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:salvage-74193-stt-thresholds
Aug 3, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:salvage-74193-stt-thresholds

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Contributor

Salvages #74193 by @PRATHAMESH75 — commit cherry-picked to preserve authorship, rebased onto current main (the original's stale-base fork CI cannot satisfy current required checks). Fixes #74178.

Context — what this fixes, for whom

Anyone using local STT (faster-whisper) with non-English speech or tuned confidence thresholds: the stt.local.no_speech_prob_threshold and stt.local.logprob_threshold config knobs only fed the POST-transcription hallucination filter, while faster-whisper's own internal gate ran first with hardcoded defaults (0.6 / -1.0) and silently dropped low-confidence segments — non-English speech decodes at lower avg_logprob, so the config knobs were dead exactly where they mattered.

What the fix does (kept verbatim)

Threads both config values into model.transcribe() via faster-whisper's documented no_speech_threshold / log_prob_threshold kwargs, reusing the existing _confidence_thresholds() helper. Defaults unchanged — behavior is identical unless a user tunes the knobs. Verified against faster-whisper's own source that both kwargs gate segment retention exactly as the PR claims.

Verification

  • tests/tools/test_stt_silence_hallucinations.py: 11 passed on current main (incl. the PR's 4 wiring tests: defaults, configurable, garbage fallback, kwargs-reach-model)
  • Mutation check: revert tools/transcription_tools.py to main → 4 tests fail; restore → 11 pass
  • Premise re-verified on current main: build_local_transcribe_kwargs still omits both kwargs
  • ruff clean

Closes #74193 (superseded by this salvage — original author credited via cherry-pick authorship).

…NousResearch#74178)

build_local_transcribe_kwargs read stt.local.no_speech_prob_threshold /
stt.local.logprob_threshold only for Hermes' post-filter
(_is_hallucinated_segment). faster-whisper's model.transcribe() never
received them, so its internal defaults (no_speech_threshold=0.6,
log_prob_threshold=-1.0) always applied and silently dropped
low-confidence segments before they reached the post-filter — making
those config knobs dead for the first gate.

Non-English speech decodes at a lower avg_logprob, so the English-tuned
defaults discard whole utterances (empty transcript despite correct
capture and language detection). Map the same config values through to
model.transcribe() so both gates stay in sync and the knobs work.
Defaults are unchanged, so behavior is identical unless a user tunes them.

Fixes NousResearch#74178
@kshitijk4poor
kshitijk4poor enabled auto-merge (rebase) August 3, 2026 08:52
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription area/config Config system, migrations, profiles labels Aug 3, 2026
@kshitijk4poor
kshitijk4poor merged commit fe6330d into NousResearch:main Aug 3, 2026
37 checks passed
@kshitijk4poor
kshitijk4poor deleted the salvage-74193-stt-thresholds branch August 5, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: faster-whisper VAD filter + default thresholds drop non-English speech

3 participants