Repository navigation
feat(speech): add a mid-utterance rule to the silence guard - #1159
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-mid-s with a required --silence-mid-min-voiced-s so a synthesis that has voiced enough finishes as silence when end of speech falls in a long run below the floor. Whole replies report the X-Silence-Mid-Trips count when the rule is configured.
|
Thanks @plotarmordev for a mid rule that only relabels the finish at end of speech and never cuts audio ( - Synthema, Ash's AI Assistant. |
… set - zig/src/core/speech_guard.zig: with both rules set, an onset cut lands on the same sample as the onset rule alone and is no mid trip, the mid relabel matches the mid rule alone, and validation, the startup sentence and the refusal cover both rules. - zig/src/native/drama_host.zig: the same two cases through the host's PCM callback and finish path, whole and streamed, each against its rule alone.
…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 79ffa80 with a maintainer fix-up (30d76b2) that tests the onset and mid rules together, thank you @plotarmordev. 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 a mid-silence rule to the Drama 3 silence guard: if speech ends during a silent run of at least
--silence-mid-sseconds after at least--silence-mid-min-voiced-sseconds of voiced audio, the reply finishes assilenceinstead ofstop, with all audio kept. It is off unless both flags are given.--silence-mid-s SECONDS: above 0 and below--silence-seconds, so it needs the guard's floor and duration.--silence-mid-min-voiced-s SECONDS: required with it. It must be positive and finite, is cumulative across pauses, includes equality and has no default.length) or by the tail rule are not mid trips.--silence-mid-sset, whole replies carryX-Silence-Mid-Trips: 0or1. Streams end with theX-Finish-Reason: silencetrailer and no count, and errors carry none. Without the flag the header is absent.--silence-floor-dbfs -50 --silence-seconds 8 --silence-mid-s 6 --silence-mid-min-voiced-s 2logsdrama3: silence guard on: a reply ends after 8 s below -50 dBFS, or as silence when it stops after 6 s below it with at least 2 s voiced.--silence-mid-sis marked. Choose it above the longest silence that ends normal replies, and the voiced minimum, on built-in or public speech; no value is recommended.Receipt
18f92204, 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. The rule reads decoded audio at end of speech and never changes tokens or samples.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.trailingtext (salts 10 and 20). Each reply carriesX-Silence-Mid-Trips: 1and finishessilencewith audio byte-identical to the off reply, where the base arm finished the same replystop. Every other silence-arm reply carriesX-Silence-Mid-Trips: 0.tools/bench_openai.py: not measured; the GPU run compared PCM, not speed. The rule adds one comparison at end of speech.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 runs at end of speech, after frame generation.CUDA_VISIBLE_DEVICES= zig build test --summary all: 210/213 steps, 2979 passed, 1 failed, 14 skipped.CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary all: 129/131 steps, 921 passed, 1 failed, 4 skipped.cortheon fuzz: every reader takes linear time on long inputs, a wall-clock test that failed the same way on the base under the same host load. No Cortheon file is changed.zig build test-kernel-contract --summary all: 65 passed.zig build test-golden --summary all: 306/319 equal with 0 unexpected differences, plus 26/26.zig build native drama3-generate -Dsm=121with the CUDA toolkit'snvcc: linked.tools/zig/test_speech_flags.py: 1 passed.zig fmt --check build.zig zigandgit diff --checkare clean.tools/zig/lean_check.pyreports the same 444 findings as main, none new.test,test-cuda-host,test-golden, the native build, the speech-flag test and the lean check passed again with no failures; counts were not recorded. Since then the code has changed only by illustrative values in one unit test (fa18b3ab).18f92204squashes 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.