A TTS that fits in your CPU (and pocket)
Python
# Train an LSD model from scratch (released Mimi codec + tokenizer, fresh FlowLM).
# The reference teacher: 400k steps at effective batch 64 (batch_size x GPUs x
# grad_accum_steps). Acoustic quality only lifts off its plateau at 150-200k
# and expressivity keeps improving to 400k, so a shorter run ships a flat
# voice -- see training/README.md before trimming max_steps.
# Any released language config works here -- it supplies the tokenizer, the
# Mimi weights and the architecture. The override makes it the 24-layer
# teacher; drop it to train a 6-layer model directly (lower quality).
model_config: pocket_tts/config/english.yaml
model_overrides:
flow_lm.transformer.num_layers: 24
start_from_pretrained: false
data:
# The quickstart's 200h subset; the reference numbers need --hours 2000.
train_jsonl: data/hifitts2_200h/train_aligned.jsonl
valid_jsonl: data/hifitts2_200h/valid_aligned.jsonl
max_duration_sec: 30.0
max_voice_prompt_sec: 5.0
flow:
type: lsd
kwargs: {}
flow_batch_multiplier: 4
eos_loss_weight: 0.1
text_dropout: 0.2
voice_dropout: 0.2
optim:
lr: 2e-4
schedule: cosine
warmup_steps: 1000
run_dir: runs/scratch
# Effective batch (batch_size x GPUs x grad_accum_steps) must reach 64 rows;
# below that the quality transition arrives late or not at all. One GPU in a
# single pass needs ~56 GiB; if that does not fit, halve batch_size and double
# grad_accum_steps until it does -- a consumer GPU runs 16 x 4 in ~16 GiB.
# On 8 GPUs use batch_size: 8.
batch_size: 64
grad_accum_steps: 1
max_steps: 400000
stats_ema_steps: 1000
ema_decay: 0.999
log_freq: 50
valid_freq: 2500
ckpt_freq: 2500
num_ckpt_keep: 3
sample_cfg_coef: 2.0 # teachers sample guided; the baked-student default is 1.0