Repository navigation
feat(speech): add an onset rule to the silence guard - #1158
plotarmordev wants to merge 2 commits 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.
Add --silence-onset-s with a required --silence-onset-voiced-s so a synthesis that has voiced less than the given minimum ends as silence after a shorter run below the floor. Both flags need the silence guard and have no defaults.
|
Thanks @plotarmordev for keeping the onset rule paired and opt-in, refusing a lone or zero flag at startup ( - Synthema, Ash's AI Assistant. |
…st.zig - Landed after #1158 and #1159, this PR takes zig/src/server/cli.zig to 606 lines, so its two remaining flag tests (--device and --segments, and the GPU engine's flags) move unchanged to zig/src/server/cli_test.zig, which reaches the private helpers through a test-only cli.Test, as log.zig's Test does.
|
Landed on main as caea205, thank you @plotarmordev. The silence guard's onset rule 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
Stacked on the silence-guard PR (#1157) and reviewable after it; independent otherwise.
Adds an onset rule to the Drama 3 silence guard: a reply that has voiced less than
--silence-onset-voiced-sseconds so far ends assilenceonce--silence-onset-sseconds run below the guard's floor, keeping its audio through that frame. It is off unless both flags are given, and without them the guard is unchanged.--silence-onset-s SECONDS: the silent run that ends a reply still under the voiced minimum. It must be positive and below--silence-seconds, so it needs the guard's floor and duration.--silence-onset-voiced-s SECONDS: the cumulative voiced time below which the rule applies. It must be positive and finite and has no default.--silence-floor-dbfs -50 --silence-seconds 8 --silence-onset-s 2 --silence-onset-voiced-s 0.25logsdrama3: silence guard on: a reply ends after 8 s below -50 dBFS, or after 2 s below it with under 0.25 s voiced. Calibrate on built-in or public speech; no value is recommended.Receipt
71b8b7a4, on the silence-guard PR's75736ad0, on 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.onsettext endedsilenceafter 2.04 s of audio in the silence arm, where the tail rule alone (base arm) ended it after 8.03 s; the kept audio is a prefix of the off reply. The silence arm's other 11silencefinishes have the base arm's audio, so the onset rule did not change them. One firing on one text exercises the rule but does not calibrate it.tools/bench_openai.py: not measured; the GPU run compared PCM, not speed. The rule adds one comparison per decoded frame when the guard is on.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 rule reads decoded audio and does not reach prompt processing.CUDA_VISIBLE_DEVICES= zig build test --summary all: 213/213 steps, 977 passed, 0 failed, 2 skipped.zig build test-lane-api-host --summary all: 222 passed.zig build test-kernel-contract test-golden --summary all: 16/16 steps, 55 passed. Goldens: 306/319 equal with 0 unexpected differences, plus 26/26.zig build native drama3-generate -Dsm=121with the CUDA toolkit'snvcc: linked.zig fmt --check build.zig zigandgit diff --checkare clean.tools/zig/lean_check.pyreports the same 444 findings as main, none new.tools/zig/test_speech_flags.pywere rerun: 1 passed, onset flags included. Since then the code has changed only by illustrative values in one unit test (919c5121).71b8b7a4squashes that branch over75736ad0, with an identical tree.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt.