Luigi commited on
Commit
831e481
·
verified ·
1 Parent(s): 32c4921

remove superseded BreezyVoice-era script

Browse files
Files changed (1) hide show
  1. scripts/run_bilingual.sh +0 -55
scripts/run_bilingual.sh DELETED
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env bash
2
- # BILINGUAL NATIVE experiment: apply the proven recipe (v4 phone-align + diverse data) symmetrically.
3
- # Merge zh-expanded corpus (15423, mark voice, incl code-mix) + diverse English-expanded (mark voice)
4
- # -> one balanced single-voice bilingual corpus -> train ONE 4.63M model good at zh AND en (+code-mix).
5
- # Run when English synth done + a GPU free. GPU via $1 (default 0).
6
- set -e
7
- ZT=/home/luigi/jetson-tts/mossnano/zhtw8k; LOG=$ZT/bilingual.log
8
- TRAIN=/home/luigi/moss-train-venv/bin/python
9
- GPU=${1:-0}
10
- VOC=$ZT/m2_vocoder_8k/hifigan-snake_8k-latest.pt
11
- exec >>"$LOG" 2>&1
12
- echo "===== BILINGUAL START $(date) GPU=$GPU ====="
13
-
14
- # 1) canonical-fix English-expand manifest wav paths from id
15
- $TRAIN - <<PY
16
- import json, os
17
- p="$ZT/teacher_corpus_en_expand/manifest.jsonl"; D="$ZT/teacher_corpus_en_expand"
18
- rows=[json.loads(l) for l in open(p) if l.strip()]
19
- ok=0
20
- for r in rows: r["wav"]=f"{D}/{r['id']}.wav"; ok+=os.path.exists(r["wav"])
21
- open(p,"w").write("\n".join(json.dumps(r,ensure_ascii=False) for r in rows)+"\n")
22
- print(f"[en-expand manifest] {len(rows)} rows, {ok} files exist")
23
- PY
24
-
25
- # 2) v4 phone-align the English-expand clips (espeak handles English natively)
26
- echo "[align en-expand] $(date)"
27
- CUDA_VISIBLE_DEVICES=$GPU $TRAIN $ZT/align_durations_v4.py \
28
- --manifest $ZT/teacher_corpus_en_expand/manifest.jsonl \
29
- --out $ZT/en_expand_v4_align.jsonl --device cuda
30
-
31
- # 3) merge zh-expanded + en-expanded -> bilingual corpus (all mark voice, speaker 0)
32
- $TRAIN - <<PY
33
- import json
34
- def fix(p):
35
- rows=[json.loads(l) for l in open(p) if l.strip()]
36
- for r in rows:
37
- if not r["target_audio"].startswith("/"): r["target_audio"]="/home/luigi/jetson-tts/"+r["target_audio"]
38
- return rows
39
- a=fix("$ZT/m_v4_v2_align.jsonl"); b=fix("$ZT/en_expand_v4_align.jsonl")
40
- out="$ZT/m_bilingual_align.jsonl"
41
- open(out,"w").write("\n".join(json.dumps(r,ensure_ascii=False) for r in a+b)+"\n")
42
- import re
43
- en=sum(1 for r in a+b if all(ord(c)<128 for c in r["text"]))
44
- print(f"[bilingual] {len(a)} + {len(b)} = {len(a)+len(b)} rows -> {out} | ~{en} pure-ASCII(en) rows")
45
- PY
46
-
47
- # 4) train the bilingual model (en-upsample 1: English now abundant via expansion)
48
- echo "[bilingual acoustic] $(date)"
49
- cd /tmp/inflect-nano
50
- CUDA_VISIBLE_DEVICES=$GPU $TRAIN -m inflect_nano.acoustic --durations-jsonl $ZT/m_bilingual_align.jsonl \
51
- --out-dir $ZT/bili_acoustic_8k --vocoder-variant snake_8k --sample-rate 8000 \
52
- --steps 60000 --batch-size 16 --lr 2e-4 --max-frames 1000 --en-upsample 1 \
53
- --vocoder-checkpoint $VOC --vocoder-mel-weight 1.0 \
54
- --save-interval 5000 --log-interval 200 --device cuda
55
- echo "===== BILINGUAL TRAIN DONE $(date) ====="