Pattern-only for <=2 words: thank you, thanks, grazie, lone you (plus EN tails on forced IT).
Requires prior accepted phrase, time window, no overlap continuation, and fails
intentional short-tail bar (strong meta + RMS + segment length).
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(space): inline client_log route in main.py for single-file HF deploy
HF container only had /app/main.py; separate client_log_route failed import.
Remove standalone module; register POST /client_log from main.py.
Co-authored-by: Cursor <cursoragent@cursor.com>
feat(api): register POST /client_log for HoloLens telemetry
Add client_log_route module and register_client_log_route(app).
Logs [client_log] event=... to Space stdout.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(it): soften zlib compression gate; ultra-short tail after phrase
- ASR_COMPRESSION_RATIO_THRESHOLD_IT (default 2.8): Italian rejects CR only when
very high, repetition obvious, or paired with nsp/alp; skip CR-only proxy when
nsp/alp missing, speech_rms>=0.035, reasonable text length.
- low_confidence_short: Italian CR paired with same skip rule.
- Per-lang last accepted phrase + ultra_short_tail_after_phrase (segment/window
configurable); continuation overlap avoids dropping same-utterance chunks.
- Logs: [it_filter] decision=accept|reject ...
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(forced-lang): reject ultra-short trimmed EN/IT segments by default
Set ASR_MIN_TRIMMED_SEGMENT_SECONDS_EN/IT defaults to 0.45 and drop
forced-language chunks when trimmed segment_s is below configured minimum.
Prevents 0.2-0.4s micro-fragments from decoding into tail artifacts.
Co-authored-by: Cursor <cursoragent@cursor.com>
feat(it): warm-load transformers by default; soften RMS for fragments
- Default ASR_WARM_LOAD_IT_TRANSFORMERS=1 with try/except so startup survives OOM.
- Italian RMS defaults: accept/normal 0.018, short 0.016; short chunk window max 2.4s.
- HoloLens Italian profile aligns RMS/short max when env unset.
- micro_ok path: strong speech below SHORT_MIN uses short RMS floors and VAD bypass like short_decode.
- Italian accept gate uses effective threshold for fragmented clips.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix: English segment word cap uses paired signals; fix Italian restore
- Default ASR_MAX_WORDS_PER_SECOND_EN=6.0; ASR_IT_RESTORE_ON_FILTER=off.
- too_many_words_for_segment: English rejects only with secondary bad signals
(no_speech/logprob/RMS<0.025/compression/caption/repetition); Italian unchanged.
- Block Italian restore when decode had text but pipeline cleared output.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(en): soften word-density reject with paired signals
Raise defaults for ASR_MAX_WORDS_PER_SECOND_EN (5.0), no-speech EN gate (0.60),
English speech RMS accept (0.018), min forced chunk (1.2). Word-density rejects only
when WPS exceeds the limit plus another weak signal (no-speech, logprob, RMS,
compression, caption substring hints, repetition).
Co-authored-by: Cursor <cursoragent@cursor.com>
tune(api-space): increase forced chunk context to 4.0s with tail trim enabled
Set forced max chunk to 4.0s, min chunk to 1.6s, and overlap to 0.2s.
Enable trailing low-energy edge trim for EN/IT by default while keeping
single-phrase decode (no internal speech splitting).
Co-authored-by: Cursor <cursoragent@cursor.com>
feat(api-space): detect and trim weak late tail continuation sentences
Add structure+audio tail-energy detector for forced EN/IT outputs.
If output is multi-sentence with short weak final sentence and low-energy tail,
trim final sentence (no lexical word blocklist). Also prevent Italian restore from
reintroducing trimmed tail continuations.
Co-authored-by: Cursor <cursoragent@cursor.com>
tune(api-space): rebalance English confidence filters for realtime speech
Raise EN no-speech threshold and relax avg-logprob cutoff so valid speech is not dropped.
Limit multi-sentence rejection to cases with both low confidence and low speech RMS.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): stricter English confidence+density rejection, less punitive Italian fallback
English: reject on no_speech_prob/logprob thresholds, word density, and short multi-sentence low-confidence outputs.
Italian: do not reject low_confidence_short solely due to missing confidence metadata; default restore on filter.
Also align defaults (EN no-speech 0.35, min chunk 1.2, Italian accept thresholds).
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): disable aggressive forced segmentation by default for realtime demo
Decode full phrase-sized forced chunks by default (no internal speech splitting).
Only optional edge silence trim remains; add ASR_FORCE_SEGMENTATION_FORCED toggle.
Relax Italian pre-decode RMS gating and align conservative runtime defaults.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): reduce pre-decode over-filtering for short strong segments
Set EN/IT trimmed minimums to 0.45s with 0.35s hard floor and allow
strong short speech (>=0.10 RMS) to decode. Lower Italian RMS thresholds
for acceptance defaults and log trimmed minimums at startup.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): relax trimmed speech segment gate for EN/IT
Trim forced chunks to strongest speech segment before Whisper, reject <1.0s segments,
and log [segment] boundaries.
Expose confidence metadata from faster-whisper segment outputs and apply shared
post-decode filters (low RMS, punctuation start, word-density, weak short follow-up,
low confidence). Keep lexical words untouched (no word blocklists).
fix(api-space): suppress weak short forced-language tails after strong chunk
For forced English/Italian, reject follow-up chunks within 2.5s when output has <=3 words
and speech_rms drops below 60% of previous accepted chunk.
Also tighten shared forced defaults for chunk sizing/overlap and EN no-speech threshold.
Add audio/timing-confidence rejection for short weak tails after strong segments
without lexical word blocklists; logs [accept]/[reject] for forced languages.
Tighten shared forced defaults (chunk max/min, overlap, no-speech EN, retries off)
and stop phrase-based thank-you stripping.
Revert "fix(api-space): strip dangling THANK YOU/THANKS after .?!; trim silence for EN"
HoloLens clients often default to auto; sanitize_forced_english_output never ran.
Run _strip_dangling_english_tail on all transcripts before uppercase.
Expand punctuation class for Unicode/fullwidth sentence endings.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): strip dangling THANK YOU/THANKS after .?!; trim silence for EN
Device POST bodies often include long silence after the utterance; Whisper
hallucinates there while the HF mic demo tends to flush tighter. Adaptive
frame RMS gate + cap on max trim; ASR_TRIM_TRAILING_SILENCE_IT=0 disables.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(api-space): force Whisper decode scores via GenerationConfig; strip dangling grazie tail after .?!
HF Whisper ignored output_scores when return_dict_in_generate stayed false on the
config; deep-copy generation_config and set both flags.
Extend dangling Italian tail cleanup to drop hallucinated GRAZIE after sentence
punctuation only (not standalone grazie or comma-led grazie).
Co-authored-by: Cursor <cursoragent@cursor.com>
Return avg_logprob and zlib token compression_ratio from generate with
output_scores; aggregate per chunk in _transcribe_chunked.
Apply confidence_meta rejection for all forced Italian decodes when
signals exist; add ASR_AVG_LOGPROB_REJECT_IT and gate Italian restore
with ASR_IT_RESTORE_ON_FILTER (default off) so filters are not undone.
Co-authored-by: Cursor <cursoragent@cursor.com>
Enforce conservative forced-Italian acceptance and exact weak-tail reject logging.
Add adaptive one-shot no-speech retries for English and Italian short chunks so brief greetings like hi/ciao/salve are less likely to be dropped.
Co-authored-by: Cursor <cursoragent@cursor.com>
Default forced-English CUDA path to quality model instead of realtime.
Reduce unstable tail hallucinations by making accuracy-first English decode the default unless explicitly overridden.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use cross-model English consensus to suppress unstable trailing token hallucinations.
When fast and strong English decodes disagree on short chunks, prefer shared-prefix/cleaner output so extra tail words are not appended.
Co-authored-by: Cursor <cursoragent@cursor.com>
Gate forced-English realtime decodes by segment confidence before fallback selection.
Use faster-whisper no-speech/logprob/compression signals to reject unstable hallucinated candidates and rerun on stronger English model.
Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve short repeated utterances and avoid blanking tiny overlap chunks.
Keep intentional consecutive words while still trimming long repetition loops, and prevent overlap dedupe from deleting one- or two-word replies like hi.
Co-authored-by: Cursor <cursoragent@cursor.com>
Retry empty forced-English chunks with a relaxed no-speech threshold.
Replace prompt-based retries with model-based candidate selection to reduce hallucinated filler words without hardcoded silencing.
Co-authored-by: Cursor <cursoragent@cursor.com>
Revert "Default Italian production path to shared faster-whisper."
Use shared backend as default for forced Italian and align Italian realtime model default to distil-large-v3 to preserve general robustness without requiring manual env tuning.
Co-authored-by: Cursor <cursoragent@cursor.com>
Improve Italian WER with accuracy-first forced decode defaults.
- Disable micro-fragment blanking by default (opt-in via ASR_DROP_MICRO_FRAGMENTS)
- Do not blank near-duplicate phrases in forced language mode by default
- Lower forced chunk default to 3.2s for steadier realtime decoding
Co-authored-by: Cursor <cursoragent@cursor.com>