Skip to content

Commit 42e7415

Browse files
meizhong986claude
andcommitted
feat(main): scope v1.8.13 segmenter default flip to safe paths
The v1.8.13 system-wide flip from silero-v3.1 to whisperseg as the default speech segmenter was applied unconditionally in main.py at the --speech-segmenter resolution layer. F4/F6/F7 acceptance testing exposed two interacting problems on the simple Transcription Mode path: 1. Config-routing bug (firewall in faster_whisper_pro_asr.py:104-110 and whisper_pro_asr.py:74-81 strips backend-agnostic grouping params chunk_threshold_s / max_group_duration_s for non-Silero backends — see v1.9.0 tracker for the architectural fix). 2. The model regression (now fixed in commit ad22a6e — large-v2 default). This commit addresses problem #1 surgically by scoping the v1.8.13 default-flip to paths that route segmenter grouping params correctly: Safe paths (whisperseg default): --ensemble (pass_worker.py:1404-1418 routes correctly) --pipeline decoupled (DecoupledPipeline kwargs path) --mode qwen (QwenPipeline explicit forwarding, v1.8.12 fix) All other paths (silero-v3.1 default): --mode balanced (without --ensemble) --mode fidelity (without --ensemble) --mode fast / faster / transformers Explicit override behavior: --speech-segmenter silero-* in any mode → passes through --speech-segmenter whisperseg/ten/nemo/whisper-vad on a non-safe path → hard warning + downgrade to silero-v3.1 with pointer to --ensemble Implementation: helper function _path_safe_for_whisperseg_default(args) returns True iff the args resolve to a path with explicit segmenter routing for non-Silero backends. Default resolution branches on this; explicit override guard also references it. Verified at runtime via --dump-params: Simple --mode balanced (no override) → silero-v3.1 ✓ --ensemble (no override) → whisperseg ✓ --mode qwen (no override) → whisperseg ✓ Explicit --speech-segmenter whisperseg on simple --mode balanced → WARNING + falls back to silero-v3.1 ✓ Verified at end-to-end via F8 acceptance run: Simple --mode balanced --sensitivity aggressive on the F4 reference clip → 51 SRT entries (vs F4's 10 with whisperseg default). This is the v1.8.13 ship-safe scope. The unified routing fix is v1.9.0 (tracked in release notes). File: whisperjav/main.py:1840-1898 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ad22a6e commit 42e7415

1 file changed

Lines changed: 48 additions & 11 deletions

File tree

whisperjav/main.py

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,19 +1837,56 @@ def main():
18371837
resolved_config["params"]["speech_segmenter"]["backend"] = "none"
18381838
logger.info("Speech segmentation disabled via --no-vad flag (backend set to 'none')")
18391839

1840-
# Apply --speech-segmenter (explicit override, or v1.8.13 default = whisperseg)
1840+
# Apply --speech-segmenter (explicit override, or v1.8.13 default).
1841+
#
1842+
# v1.8.13 ships a SCOPED default flip. Whisperseg becomes the default only on
1843+
# paths that correctly route segmenter grouping params (chunk_threshold_s,
1844+
# max_group_duration_s, etc.) to non-Silero backends. Simple --mode balanced
1845+
# and --mode fidelity go through FasterWhisperProASR / WhisperProASR whose
1846+
# CONSTRUCTOR FIREWALL strips those params for non-Silero backends, causing
1847+
# whisperseg to fall back to its 29s default max_group_duration_s and trigger
1848+
# a Whisper repetition pathology on JAV moaning content (catastrophic empty
1849+
# output — see F4/F6 acceptance tests). Fix is tracked for v1.9.0 (split
1850+
# SileroVADOptions, introduce SegmenterGroupingOptions, eliminate firewall).
1851+
# Until then, simple modes default to silero-v3.1 (the v1.8.12 default,
1852+
# known-good baseline). Users who want whisperseg in v1.8.13 use --ensemble.
1853+
def _path_safe_for_whisperseg_default(_args):
1854+
"""Paths with explicit segmenter-param routing for non-Silero backends."""
1855+
if getattr(_args, 'ensemble', False):
1856+
return True # pass_worker.py:1404-1418 routes correctly
1857+
if getattr(_args, 'pipeline', None) == 'decoupled':
1858+
return True # DecoupledPipeline kwargs path
1859+
if getattr(_args, 'mode', None) == 'qwen':
1860+
return True # QwenPipeline explicit forwarding (v1.8.12 fix)
1861+
return False
1862+
18411863
speech_segmenter = getattr(args, 'speech_segmenter', None)
18421864
if speech_segmenter is None and resolved_config is not None:
1843-
# v1.8.13: when user didn't pass --speech-segmenter, populate the
1844-
# system-wide default (whisperseg) into resolved_config. This keeps
1845-
# the resolver output, dump_params output, and runtime behavior
1846-
# consistent. Without this, the dump would show silero VAD presets
1847-
# (from the resolver's `vad` field) with no speech_segmenter.backend,
1848-
# which is misleading — the runtime fallback in whisper_pro_asr.py
1849-
# would still produce whisperseg behavior, but the dump wouldn't
1850-
# show it.
1851-
speech_segmenter = "whisperseg"
1852-
logger.debug("No --speech-segmenter passed; using v1.8.13 default: whisperseg")
1865+
if _path_safe_for_whisperseg_default(args):
1866+
speech_segmenter = "whisperseg"
1867+
logger.debug("No --speech-segmenter passed; using v1.8.13 default: whisperseg")
1868+
else:
1869+
speech_segmenter = "silero-v3.1"
1870+
logger.debug(
1871+
"No --speech-segmenter passed; --mode %s uses silero-v3.1 "
1872+
"(v1.8.12 default — non-Silero routing for simple modes is a v1.9.0 fix). "
1873+
"Use --ensemble to enable whisperseg.",
1874+
getattr(args, 'mode', None)
1875+
)
1876+
1877+
# Guard: explicit non-Silero choice on a path with the routing bug → downgrade with warning.
1878+
if speech_segmenter is not None and resolved_config is not None:
1879+
if (not _path_safe_for_whisperseg_default(args)
1880+
and speech_segmenter != "none"
1881+
and not speech_segmenter.startswith("silero")):
1882+
logger.warning(
1883+
"Speech segmenter '%s' is not supported in --mode %s due to a known "
1884+
"v1.9.0 routing bug (catastrophic empty output on JAV moaning content). "
1885+
"Falling back to silero-v3.1. Use --ensemble for full WhisperSeg / TEN / "
1886+
"NeMo / whisper-vad support.",
1887+
speech_segmenter, getattr(args, 'mode', None)
1888+
)
1889+
speech_segmenter = "silero-v3.1"
18531890

18541891
if speech_segmenter is not None and resolved_config is not None:
18551892
if "params" not in resolved_config:

0 commit comments

Comments
 (0)