Tune the delivery knobs against real recordings - #4
Open
MattModeCode wants to merge 1 commit into
Open
Conversation
Adds `double-chin tune`, which searches exaggeration, cfg_weight, temperature and rate for the values that make synthesized takes least distinguishable from the user's own recordings, and wires the result into the app as the profile Studio opens with. - src/double_chin/delivery.py: validated DeliveryProfile, the neutral and tuned profiles, and atomic persistence to ~/.double-chin/delivery.json with a logged fallback so a corrupt settings file cannot stop the app from opening. - src/double_chin/tuning/: coordinate-descent search scoring each candidate as a set of takes through the existing indistinguishability gate, with a measured noise floor, a held-out check, a resumable JSONL ledger and a synthesis budget. What the search ranks on is a parameter, because the gate's discrimination component is saturated in this configuration. - GET /api/delivery serves the opening profile and the neutral baseline, so the frontend stops hardcoding knob values; "Match my voice" restores the tuned profile and "Reset to neutral" goes to the engine baseline. Result on the owner's voice (docs/tuning.md): a tie for expression, adherence and variation — the tuning-script winner did not survive the held-out check — so the tuned profile is the neutral one. Speaking rate is the one clear finding and it is negative: any value other than 1.00x drops speaker similarity from ~0.66 to ~0.40. Claude-Session: https://claude.ai/code/session_01FdWprv4TKfVzapYFJnRffz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
double-chin tune: a parameter search over the four delivery controls (expression, reference adherence, variation, speaking rate), scored against the user's own recordings with the existing indistinguishability gate, plus the plumbing that makes the result the profile Studio opens with.Stacked on
feat/liquid-glass-studio(#3) because it edits that branch's studio frontend.What it does
src/double_chin/delivery.py—DeliveryProfilewith validation, the neutral and tuned profiles, and atomic persistence to~/.double-chin/delivery.json. A missing, corrupt or out-of-range file falls back to the tuned profile with a logged reason; a bad settings file must never stop the app opening.src/double_chin/tuning/— coordinate descent over a 0.05-step grid. Each candidate is synthesized several times and scored as a set throughindistinguishability_gate. Before searching, the baseline is re-measured with different seeds to size run-to-run noise; a winner that does not clear that spread is reported as a tie. Every measurement lands in a resumable JSONL ledger, and a synthesis budget caps the run.GET /api/delivery— serves the opening profile and the neutral baseline. The frontend hydrates from it instead of hardcoding knob values.What the run found
Ranking had to be made explicit: the gate's
discriminationcomponent is 0.000 for every candidate here (eight real clips against three clone clips separate outright), which collapses the composite to ~0.026 for everything. The search ranks on the three components that respond, with the gate's own weights, and records the full gate result anyway.So
TUNED_PROFILEis the neutral profile, anddocs/tuning.mdsays why rather than dressing up a fitted win.Test plan
DOUBLECHIN_E2E=1gates them)/api/delivery, a saved profile, and a corrupt settings fileapp.jstouches exists inindex.htmlDOUBLECHIN_E2E=1 pytest -m slow(real-modeltunepath) not run in this sessionhttps://claude.ai/code/session_01FdWprv4TKfVzapYFJnRffz