#!/usr/bin/env bash # Night of 2026-11-26, part 5 (GPU 0, queued ~02:15 UTC, starts when night4's Ctex-m2 ends ~02:30). # Fit vocoder C to T2's pairs (T2 = texture loss from 1 kHz; its own motion matches the real # speaker in every band) WITH a vocoder texture term (scripts/train_vocoder_texture.py, # VOCODER_TEXTURE=5 from 1 kHz). Plain pairs fitting (Ctex, mel 5) averaged T's motion away, # because it does not line up with the recording. The term asks the vocoder's output to change # from frame to frame as much as the recording does. # Same recipe as Ctex otherwise: init C 132k, fresh cosine 5e-5, 500 warm-up, mel 5, 20k steps. # Run detached in the v3 image: # docker compose run -d --name tiny-voca-dk-night5 kit-v3 \ # bash -c "bash scripts/night5_chain.sh > checks/night5-chain.log 2>&1" set -uo pipefail cd /opt/kit stamp() { echo "== stage $1 $(date -u +%FT%TZ)"; } wait_gpu() { # device index, free bytes needed until CUDA_VISIBLE_DEVICES=$1 python -c "import sys, torch; sys.exit(0 if torch.cuda.mem_get_info(0)[0] > $2 else 1)" 2>/dev/null do sleep 30; done; } GPU=${GPU:-0} OUT=runs/vocoder-r12-CT2-vtex stamp wait-night4 until grep -q "^exit=" checks/night4-chain.log 2>/dev/null; do sleep 60; done START=(--init-from runs/vocoder-r7-C/last.pt --fresh-schedule); [[ -f "$OUT/last.pt" ]] && START=(--resume) wait_gpu "$GPU" 8e9 stamp vocoder CUDA_VISIBLE_DEVICES=$GPU VOCODER_TEXTURE=5 VOCODER_TEXTURE_LOW_HZ=1000 python scripts/train_vocoder_texture.py "${START[@]}" \ --prior --prior-high-hz 2500 --prior-high-gain 0.05 --prior-gain-range 0.0 0.1 --mel-weight 5 \ --manifests data/full-features/train.jsonl --validation data/full-features/validation.jsonl --output "$OUT" \ --steps 152000 --learning-rate 5e-5 --warmup 500 --batch 32 --teacher vocos --distill-mode spectrum --distill-weight 4 \ --pairs data/vocoder-pairs-tex1k140k/train/pairs.jsonl --pair-fraction 0.7 \ --device cuda --workers 6 --save-every 1000 --keep-every 4000 >> "$OUT.log" 2>&1 code=$? [[ $code -eq 0 ]] && cp --update=none "$OUT/vocoder.pt" models/vocoder-r12-CT2-vtex-s152000.pt echo "exit=$code $(date -u +%FT%TZ)"