Download recipe/filter/README.md from KaleComputer/kale-tts-1-tiny: direct link, hf CLI and curl.
- Browser
- Download file 5.74 kB
-
https://huggingface.co/KaleComputer/kale-tts-1-tiny/resolve/main/recipe/filter/README.md
- Command line
-
hf download hf://KaleComputer/kale-tts-1-tiny/recipe/filter/README.md
-
curl -L -o README.md https://huggingface.co/KaleComputer/kale-tts-1-tiny/resolve/main/recipe/filter/README.md
recipe/filter: keep only clean takes
Measures every rendered take and keeps it only if it is complete, read back exactly, cleanly edged, in pace, on pitch, the same voice and free of rough (creaky / cut-off) sentence ends, checked on every sentence end.
Release path (batch, what kept the release data), after ../render/render.py:
modal run filter.py::main --group <g> --per-call 400 # Whisper read-back, edges, pace, pitch, ECAPA-TDNN embedding (GPUs)
modal run filter.py::ends_main --group <g> --per-call 150 # rough-ending measure, final end + inner pause ends (CPUs)
modal run filter.py::keepall --groups <g> # keep.py rules -> /data/kept/kept-<g>.jsonl, results/kept-summary.json
modal volume get <data_volume> /kept/kept-<g>.jsonl work/kept-<g>.jsonl
modal run strict.py::main --which <g> # every sentence end of kept passages via CTC alignment -> work/strict-<g>.jsonl
python3 -I final.py <voice> --kept work/kept-<g>.jsonl --strict work/strict-<g>.jsonl
Inputs: work/jobs-<g>.jsonl, work/render-<g>/chunk-*.json, the renders on the data volume. Outputs: work/measure-<g>.slim.jsonl,
work/kept-<g>.jsonl, work/strict-<g>.jsonl, and per voice work/final-<voice>.jsonl, work/rows-<voice>.jsonl (clip, split
train/val 99:1, text, path; the train step's prep input), work/ids_<voice>.json (if ids were made at job time),
results/final-summary-<voice>.json.
Rules (config/filter.json, release values): Maya end token; Whisper large-v3-turbo read-back with 0 missed and 0 extra words;
20 ms-0.8 s silence before, <= 0.8 s after, not cut off, no full-scale sample; 100-230 spoken wpm (s057b 270, her natural pace);
pitch within 15 % of the voice's median; ECAPA-TDNN cosine >= 0.46 to the voice's own centroid (mean of its closest 60 %; whisper
0.42; the release used WavLM-sv at 0.88 / 0.80, replaced because its pretraining data is non-commercial, see keep.py);
rough-ending measure < 100 ms on every end, pitch floor 70 Hz for men and 110 Hz for women; one rough inner sentence end drops a passage.
Bench-style detector for men (open point in our notes): in this keep.py it is recorded only (bench_flag) and never drops a take.
The per-voice exemption test (> 5 % median-pitch shift) is still computed and listed as bench_exempt_voices in the summary, with no
effect. An earlier copy dropped on it unless the voice was exempt, which deleted most male takes.
Recommended streaming shape: stream_filter.py (one warm container per GPU loads Maya-1, SNAC, Whisper, UTMOS and ECAPA once, renders
and scores each chunk in place), then select_stream.py:
modal deploy stream_filter.py
python stream_filter.py <group> # design/candidates-<group>.json -> design/stream-<group>.jsonl + pick wavs
python3 -I select_stream.py <group> --refs design/ref-centroids.json
Config: config/stream.json (GPUs, takes per line, the fixed test line, pass rules: >= 2 clean test-line takes, unclear <= 6 per 100
words, UTMOS >= 3.5 / line >= 3.0, 160-200 wpm, ECAPA cosine < 0.80 to model voices and < 0.85 to selected ones),
config/stream_designs.example.json (input format). Names from ../config/modal.json (filter_app, stream_app, data_volume).
Files and sources (our research scripts, copied and trimmed):
filter.py<- the 10-voice build's filter. Trimmed: two-volume read fallback (we outgrew a volume's file limit mid-build) -> one data volume; chunk lookup reduced torender.py's layout; GPU/CPU caps from config; bench-side diagnostics (pause breaks, bench voice match, CLAP tag pairs) removed. The CLAP score for whisper / tag takes stays (unused by the release voices).keep.py<- the build's keep rules; thresholds moved to config (same values), comments reworded.strict.py<- the build's every-sentence-end check. Trimmed: the male list (ids of many earlier designs) ->male_voicesin config; one volume; caps from config.align(Whisper word times) stays for reference;mainuses the CTC aligner.final.py<- the data half of the build's prep script (kept + strict -> final list). Trimmed: the call that started feature prep on the training app (now in the train step); a group file can be passed and is split per voice.stream_filter.py<- the streaming render + screen app plus its small client driver (now__main__). Trimmed: names, GPU cap and test line from config.select_stream.py<- the streaming pick. Trimmed: publishing to our internal listening page (mp3 at -16 LUFS, manifest, archive rule); the pace window is always on (config); reference centroids come from--refs.- Not copied: an earlier version of the filter scripts in this folder (filter, strict check and keep rules; same maths; differences: an older male-voice rule that drops on the bench-style detector, a fixed pace ceiling, a per-take pitch floor field). It kept m3's earlier data.
Known gaps: stream_filter.py screens voice designs (12 takes each); streaming the full training render through the same checks is
the recommended shape but this release didn't do it, so there's no script for that yet. Measuring models (all commercially licensed,
evaluation-only): Whisper (MIT), the forced aligner wav2vec2-large-960h-lv60-self (Apache-2.0, same as recipe/bench; the release pass
used torchaudio wav2vec2-base-960h, MIT), ECAPA (speechbrain, Apache-2.0), CLAP (Apache-2.0), UTMOS22 via
tarepan/SpeechMOS (MIT, weights derived from the official UTMOS22 checkpoint under MIT). Male detection in
filter.py::ends_main reads the description (" male voice"); write designs in Maya-1's format or set the floor yourself.