File size: 3,926 Bytes
adabee1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/env bash
# Night of 2026-11-25, part 3 (GPU 1, started ~23:10 UTC).
# Scores of T and M with vocoder C 132k (AGENTS.md Round 4, "Night part 2"): T (--texture 20)
# brought vowel motion from -14%/-16% to -3%/-6% of the real speaker at 2-4/4-8 kHz. M
# (--mel-critic) changed nothing, so its vocoder run was stopped. 1-2 kHz is still 10% short
# because the texture bands start at 2 kHz, so:
# 1. T2 = T continued 120k -> 140k with the texture loss from 1 kHz
# (scripts/train_texture_low.py, TEXTURE_LOW_HZ=1000), runs/v3trim-tex1k;
# 2. vocoder pairs from T2;
# 3. vocoder Ctex (T-adapted C, runs/vocoder-r9-Ctex, GPU 0 until ~00:20) adapted again to the
# T2 pairs with mel weight 2 (fresh cosine 5e-5, 20k steps): runs/vocoder-r10-Ctex1k-m2.
# Changed at 00:40 from mel 5: Ctex (mel 5) smoothed T's added motion away (T DSP 0.450 /
# 0.406 at 2-4 / 4-8 kHz, real 0.442 / 0.398; T + C 0.421 / 0.368; T + Ctex 0.379 / 0.331).
# The texture is the right amount but not aligned with the recording, so a pairs-trained
# vocoder regresses it to the mean. A lower mel weight leaves more to the critics.
# Run detached in the v3 image:
# docker compose run -d --name tiny-voca-dk-night3 kit-v3 \
# bash -c "bash scripts/night3_chain.sh > checks/night3-chain.log 2>&1"
set -uo pipefail
cd /opt/kit
stamp() { echo "== stage $1 $(date -u +%FT%TZ)"; }
fail() { echo "exit=1 stage=$1"; exit 1; }
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:-1}
ANN=data/v3trim-prepared/annotations
OUT=runs/v3trim-tex1k
VOICE=models/v3trim-tex1k-s140000.pt
PAIRS=data/vocoder-pairs-tex1k140k
VOC=runs/vocoder-r10-Ctex1k-m2
if [[ ! -f "$VOICE" ]]; then
START=(--init-from runs/v3trim-tex/last.pt); [[ -f "$OUT/last.pt" ]] && START=(--resume "$OUT/last.pt")
wait_gpu "$GPU" 13e9
stamp voice
CUDA_VISIBLE_DEVICES=$GPU TEXTURE_LOW_HZ=1000 python scripts/train_texture_low.py \
--train "$ANN/train.jsonl" --validation "$ANN/validation.jsonl" \
--config work/config.v3trim-vml.json --output "$OUT" --device cuda --steps 140000 --batch-frames 9000 --max-batch 32 \
--gan-start 8000 --gan-ratio 0.7 --teacher-final 0 --save-every 1000 --keep-every 5000 --log-every 50 \
--max-seconds inf --stop-file "$OUT/STOP" --texture 20 "${START[@]}" >> "$OUT.log" 2>&1 || fail voice
python tiny-voca/scripts/export_checkpoint.py --checkpoint "$OUT/last.pt" --output "$VOICE" > /dev/null || fail export
fi
stamp pairs
CUDA_VISIBLE_DEVICES=$GPU python scripts/make_pairs.py --checkpoint "$VOICE" \
--annotations "$ANN/train.jsonl" --output "$PAIRS/train" --device cuda | tail -1 || fail pairs
stamp wait-ctex
until grep -q "^tex exit=" checks/night2-chain.log 2>/dev/null; do sleep 60; done
INIT=runs/vocoder-r9-Ctex/last.pt; grep -q "^tex exit=0" checks/night2-chain.log || INIT=runs/vocoder-r7-C/last.pt
START=(--init-from "$INIT" --fresh-schedule); [[ -f "$VOC/last.pt" ]] && START=(--resume)
STEPS=$(( $(python -c "import torch; print(torch.load('$INIT', map_location='cpu', weights_only=False)['step'])") + 20000 ))
stamp "vocoder init=$INIT steps=$STEPS"
CUDA_VISIBLE_DEVICES=$GPU python -m tiny_voca.train_vocoder "${START[@]}" --prior --prior-high-hz 2500 --prior-high-gain 0.05 \
--prior-gain-range 0.0 0.1 --mel-weight 2 \
--manifests data/full-features/train.jsonl --validation data/full-features/validation.jsonl --output "$VOC" \
--steps "$STEPS" --learning-rate 5e-5 --warmup 500 --batch 32 --teacher vocos --distill-mode spectrum --distill-weight 4 \
--pairs "$PAIRS/train/pairs.jsonl" --pair-fraction 0.7 \
--device cuda --workers 6 --save-every 1000 --keep-every 4000 >> "$VOC.log" 2>&1 || fail vocoder
cp --update=none "$VOC/vocoder.pt" "models/vocoder-r10-Ctex1k-m2-s$STEPS.pt"
echo exit=0
|