Repository navigation
feat(speech): redraw whole speech replies that end too short - #1161
plotarmordev wants to merge 5 commits into
Conversation
--allowed-controls keeps listed delivery controls in a normalized form and strips other cue-only brackets before speech input validation; contextual and unknown brackets stay as written. The built-in cue word list holds only words from tags in Fish Audio's public sources.
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.
Bring the opt-in --allowed-controls filter onto the silence guard so silence redraws can reuse its rules. The two changes touch separate flags; only the changelog and the flag parser needed joining.
Add --silence-redraws with an optional --silence-redraw-budget-s and --silence-redraw-controls so a whole reply that ends as silence is drawn again with a salted seed while the budget and X-Deadline-S allow. Streams are never redrawn, and enabled redraws report X-Silence-Redraws.
Add --short-reply-ratio and --short-reply-chars-per-s so a whole reply of 200 characters or more that finishes stop with too little audio for its text is redrawn under the --silence-redraws count, budget and controls. Neither flag has a default, and each needs the other.
|
Thanks @plotarmordev for keeping the short rule opt-in and paired, judging only - Synthema, Ash's AI Assistant. |
|
Landed on main as d091214, thank you @plotarmordev. Whole speech replies that end too short are redrawn. 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-redraws PR (#1160); review the diff against its tip
49ea53bd.Adds opt-in
serve --short-reply-ratio R --short-reply-chars-per-s CPS. A whole Drama speech take that finishesstopwith less than R × chars / CPS seconds of audio is redrawn as a silenced take is, under the same--silence-redrawscount, budget and controls.--silence-redrawsof 1 or more, so text models refuse them through that flag. Without both flags, nostopis redrawn and replies are unchanged.stopfinishes are judged;lengthnever is, and asilencefinish trips as before.--allowed-controlsfiltering. For a redraw, it is the input after--silence-redraw-controlsfiltering.X-Silence-Redraws, as silence redraws do.stopreplies, asdocs/speech-redraws.md#short-repliesdescribes.--silence-redraws 2 --short-reply-ratio 0.6 --short-reply-chars-per-s 12.Receipt
2cef6e88, on the silence-redraws PR's49ea53bd, 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.stopfrom a text of 200 characters or more: thetrailingtext at salt 0, with 12.45 s of audio against a 10.65 s threshold. It was not short, so no short redraw ran. The run shows only that, with the short-reply flags set, redraws ran for silenced takes alone and replies where nothing fired equal off byte for byte.stopis submitted once, as before. A short take's redraw k uses exactlyseedFor(prompt, salt + k).tools/bench_openai.py: not measured; the GPU run compared PCM, not speed. The check runs once per finished whole take with redraws on. It counts code points only for astopof 200 bytes or more with both flags set.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 check runs after a take finishes and does not reach prompt processing.zig build test --summary all: 213/213 steps, 821/823 passed, 2 skipped (steps with unchanged inputs were cached).CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary all: 131/131 steps, 599/599 passed.fuzz-cortheonalone then passed 11/11.test-server-cpu: 532/532.test-kernel-contract: 65/65.test-golden: 306/319 equal, 0 unexpected differences; additional corpus 26/26.drama3-generatebuild succeeded.tools/zig/test_speech_flags.py: 1 test, OK.37079ece:zig fmt --checkpassed.zig build test --summary all: 213/213 steps, 3003/3017 passed, 14 skipped.CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary all: 131/131 steps, 1524/1528 passed, 4 skipped.tools/zig/test_speech_flags.py: 1 test, OK.40ed23e3, the unsquashed branch tip, after merging the silence-redraws tip2e6d4858, which changes one plain-speech test input:zig fmt --checkpassed, andzig build test --summary allpassed 213/213 steps, 3003/3017 tests, 14 skipped.2cef6e88, which squashes that branch over49ea53bd:zig fmt --checkpassed, andzig build test --summary allpassed 213/213 steps, 3004/3018 tests, 14 skipped.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt.