Repository navigation
feat(speech): add opt-in sustained silence guard for Drama speech - #1157
plotarmordev wants to merge 1 commit into
Conversation
Add --silence-floor-dbfs and --silence-seconds so native Drama speech can stop after a sustained run below an explicit frame-power floor, keeping the audio and reporting the finish as silence. The guard is off unless both flags are set and is refused for non-speech models.
|
Thanks @plotarmordev for a guard that stays fully off unless both thresholds are given, refuses the flags on non-Drama models before anything loads ( - Synthema, Ash's AI Assistant. |
… its flag test to cli_test.zig - zig/build/drama3_host.zig: metal() links Metal, Foundation and objc on its runtime module, as h3_host.zig does, so check-drama-metal-host links and runs on a Mac. - The silence guard flag test moves unchanged from zig/src/server/cli.zig to zig/src/server/cli_test.zig, leaving cli.zig room for the flags of the PRs stacked on this one.
|
Landed on main as e4e2280 with a maintainer fix-up (82e1ae1), thank you @plotarmordev. The opt-in sustained-silence guard for Drama speech is in. On a GB10, the default Drama output stayed byte-identical to main on six inputs with these options off, repeats were 6/6 equal, and concurrent equalled solo. The speech, Drama, server and golden host suites pass on current main. - Synthema, Ash's AI Assistant. |
|
This shipped in TensorFold 1.1.4: https://github.com/ashhart/TensorFold/releases/tag/v1.1.4 Thank you @plotarmordev for the contribution. - Synthema, Ash's AI Assistant. |
What this changes
Adds an opt-in silence guard to native Drama 3 speech, shared by CUDA and Metal: when decoded audio stays below a floor for a set time, the reply stops, keeps the audio up to that point and finishes as
silence. It is off unless both thresholds are given, and with it off nothing changes.--silence-floor-dbfs DBFS: mean-square power floor per codec frame (2048 samples at 44.1 kHz), at most 0, no default. Frames strictly below it are silent; a frame at or above it resets the run.--silence-seconds SECONDS: the continuous silent run that ends a reply. Unset or 0 is off; a positive value needs the floor.X-Finish-Reason: silence, as a header on whole replies and as the trailer on streams.--silence-floor-dbfs -50 --silence-seconds 8logsdrama3: silence guard on: a reply ends after 8 s below -50 dBFS.This is independent of #1119, #1120, #1134 and #1135 and can be reviewed in any order.
Receipt
75736ad0on maind1018b31. Host tests: Linux aarch64, Zig 0.17.0, CPU only, no MLX or PyTorch. GPU run: one NVIDIA GB10, native CUDA build (-Dsm=121), no MLX or PyTorch, checkpointfishaudio/drama-3with itscodec.pth(revision not recorded), built-in voice. Stock is upstreamd1018b31. The candidate isca60e9c8, an integration of all the open Drama patches ond1018b31, this one included, not this branch's tip.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: speech returns PCM, so PCM is compared by SHA-256.TENSORFOLD_SEED_SALT0, 10 and 20), each sent the same 10 public synthetic texts: 180 requests, all complete. Every server ran with--parallel 1 --no-drafts --prompt-cache-gib 0 --context 4096andTF_DRAMA_PREFILL_ROWS=1, which keeps the candidate on stock's prefill schedule.--silence-floor-dbfs -50 --silence-seconds 8("base"); base plus--silence-onset-s 2 --silence-onset-voiced-s 0.4 --silence-mid-s 2 --silence-mid-min-voiced-s 0.4("silence"); silence plus--silence-redraws 2 --silence-redraw-budget-s 60 --silence-redraw-controls '' --short-reply-ratio 0.6 --short-reply-chars-per-s 12("redraw"); and--register-redraw-st 6 --register-redraw-high 50 --register-high-hz 300 --silence-redraw-budget-s 60("register").silenceor was judged short. Each of the 22 silenced takes in the base and silence arms is a prefix of the off audio.silence, each keeping a prefix of the off audio, and the other 20 equal off byte for byte. Finish reasons: off 23stopand 7length; base 18stop, 10silenceand 2length.tools/bench_openai.py: not measured; the GPU run compared PCM, not speed.ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: n/a. The guard reads decoded audio after frame generation and does not reach prompt processing.CUDA_VISIBLE_DEVICES= zig build test --summary all -j1: 210/213 steps, 1291 passed, 3 failed, 7 skipped. The failures are wall-clock bounds in files this change does not touch: the Cortheon linear-time fuzz test and two benchmark-stream elapsed-time assertions. No bound was changed.zig build fuzz-cortheon -Dfuzz-optimize=Debug --summary all, run alone: 11 passed, 0 failed.tools/zig/test_speech_flags.pyagainst the native build: 1 passed, 0 skipped.zig build native -Dsm=121with the CUDA toolkit'snvcc: 98/98 steps.test-cuda-host1045 passed, 4 skipped;test-kernel-contract65 passed;test-golden306/319 equal with 0 unexpected differences, plus 26/26.zig fmt --check build.zig zigandgit diff --checkare clean.tools/zig/lean_check.pyreports the same 444 findings as main, none new.75736ad0squashes the branch these counts come from, with an identical tree.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt.