KaedeTai commited on
Commit
71b0dae
·
verified ·
1 Parent(s): 4da5d3f

Add model card

Browse files
Files changed (1) hide show
  1. README.md +176 -0
README.md ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - nan
5
+ - zh
6
+ - en
7
+ library_name: GPT-SoVITS
8
+ tags:
9
+ - text-to-speech
10
+ - tts
11
+ - voice-cloning
12
+ - taiwanese
13
+ - hokkien
14
+ - poj
15
+ - peh-oe-ji
16
+ - gpt-sovits
17
+ pipeline_tag: text-to-speech
18
+ base_model:
19
+ - lj1995/GPT-SoVITS
20
+ ---
21
+
22
+ # GPT-SoVITS Taiwanese (Hokkien) — Trilingual S1 + r4 e15 S2
23
+
24
+ Pre-trained weights for the Taiwanese (Hokkien / Pe̍h-ōe-jī) fork of
25
+ [GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS). The S1 is
26
+ trilingual (TW + ZH + weak EN) thanks to embedding transplant; the S2
27
+ is a v2ProTw vocoder finetuned on Taiwanese audio.
28
+
29
+ **Inference code, sandhi preprocessor, training recipe, and Traditional
30
+ Chinese documentation:**
31
+ [github.com/KaedeTai/GPT-SoVITS](https://github.com/KaedeTai/GPT-SoVITS) ·
32
+ [TAIWANESE.md](https://github.com/KaedeTai/GPT-SoVITS/blob/main/TAIWANESE.md) ·
33
+ [TAIWANESE.zh-tw.md](https://github.com/KaedeTai/GPT-SoVITS/blob/main/TAIWANESE.zh-tw.md)
34
+
35
+ ## Files
36
+
37
+ | File | Size | What |
38
+ |------|------|------|
39
+ | `s1_trilingual.ckpt` | 156 MB | S1 GPT — TW (sandhi-trained, e15) + transplanted base ZH/EN embeddings |
40
+ | `s2_r4_e15.pth` | 952 MB | S2 SoVITS v2ProTw — full-state ckpt at epoch 15 of finetune run r4 |
41
+
42
+ ## Quick start
43
+
44
+ ```bash
45
+ git clone https://github.com/KaedeTai/GPT-SoVITS.git
46
+ cd GPT-SoVITS
47
+ python3.11 -m venv .venv && source .venv/bin/activate
48
+ pip install --upgrade pip
49
+ pip install -r requirements.txt
50
+ ./download_pretrained.sh # upstream base pretraineds (BERT, hubert, etc.)
51
+
52
+ # Pull these weights
53
+ hf download KaedeTai/gpt-sovits-tw s1_trilingual.ckpt --local-dir ./models
54
+ hf download KaedeTai/gpt-sovits-tw s2_r4_e15.pth --local-dir ./models
55
+
56
+ # One-line synthesis (POJ-with-diacritics in, mp3 out)
57
+ python -m tw_inference.tts_cli "Lí hó, sè-kài!" -o hello.mp3
58
+ ```
59
+
60
+ Or the local web UI:
61
+
62
+ ```bash
63
+ python -m tw_inference.webui # → http://127.0.0.1:5557/
64
+ ```
65
+
66
+ ## Quality
67
+
68
+ | Language | Fluency | Pronunciation | Notes |
69
+ |----------|---------|---------------|-------|
70
+ | Taiwanese (POJ) | ~80 / 100 | ~75 / 100 | Single trained speaker; long sentences (>60 syllables) occasionally drift. |
71
+ | Mandarin (中文) | usable | usable | Preserved via embedding transplant from `s1v3` base. |
72
+ | English | weak | weak | Base never had real English; included for completeness only. |
73
+
74
+ Code-switching within one utterance is **not supported** — use
75
+ `{tw:...}` / `{zh:...}` markup per segment.
76
+
77
+ ## Architecture
78
+
79
+ Two-stage TTS:
80
+
81
+ - **S1 (GPT)** — autoregressive token model mapping POJ phoneme tokens
82
+ → SoVITS semantic codes. Vocabulary expanded from 732 → 1033 (301
83
+ Taiwanese `tw_*` tokens added on top of the upstream Mandarin
84
+ vocabulary). The trilingual variant preserves Mandarin by
85
+ transplanting rows 0..731 of the embedding table from a clean
86
+ `s1v3` checkpoint back into the TW-finetuned ckpt.
87
+ - **S2 (SoVITS v2Pro / v2ProTw)** — non-autoregressive vocoder; takes
88
+ semantic codes + a speaker embedding (cnhubert + sv) and produces
89
+ 32 kHz mono waveform.
90
+ - **Sandhi preprocessor** — applies standard Taiwanese tone-sandhi
91
+ rules to citation-tone POJ before tokenization, so the model sees
92
+ the tone sequence speakers actually produce. 13 flags; defaults
93
+ match the eval configuration that produced our best reported CER.
94
+
95
+ ## Training data
96
+
97
+ - **MoE Tâi-uân-gí 教育部臺灣閩南語常用詞辭典** example sentences
98
+ (majority of the corpus).
99
+ - **Common Voice `nan-tw`** validated split.
100
+ - Multi-speaker. Per-segment 3-12 s, 32 kHz mono, loudness normalised.
101
+ - Labels: POJ with diacritics, pre-processed with the sandhi
102
+ preprocessor so the written form matches the audio realisation.
103
+
104
+ Total: roughly 15-25 hours of paired audio + POJ.
105
+
106
+ ## Evaluation
107
+
108
+ Reported quality is from human listening; ASR-based CER was used for
109
+ ablations but flattens out at the top of the quality curve.
110
+
111
+ | Test set | Stack | Mean POJ-CER (BreezeASR-26-derived) |
112
+ |----------|-------|--------------------------------------|
113
+ | Canonical 5-sentence | S1 trilingual e15 + S2 r4 e15 + sandhi v1 | **4.44%** |
114
+ | 13-sentence long content | same | ~15% |
115
+
116
+ Per-sentence breakdown for the 5-sentence set is in
117
+ [`tw_samples/eval_summary.json`](https://github.com/KaedeTai/GPT-SoVITS/blob/main/tw_samples/eval_summary.json)
118
+ in the GitHub repo. Demo mp3s are in
119
+ [`tw_samples/demo_*.mp3`](https://github.com/KaedeTai/GPT-SoVITS/tree/main/tw_samples).
120
+
121
+ ## Known limitations
122
+
123
+ - **English is weak.** Don't ship this for English use cases.
124
+ - **Long sentences drift** past ~60 syllables. The inference pipeline
125
+ splits at punctuation to mitigate but doesn't eliminate this.
126
+ - **Code-switching not supported** within a single utterance.
127
+ - **Single training speaker fidelity** is capped by the multi-speaker
128
+ corpus heterogeneity; with a single-speaker corpus we'd expect
129
+ higher voice consistency but narrower coverage.
130
+ - **POJ input only.** No built-in Han-character → POJ pipeline.
131
+ - **MPS nondeterminism.** Same seed + same machine still produces
132
+ audibly different output across runs (5-10% spread).
133
+
134
+ ## How this was built (short version)
135
+
136
+ The long version with lessons learned and what we'd do differently is
137
+ in [TAIWANESE.md](https://github.com/KaedeTai/GPT-SoVITS/blob/main/TAIWANESE.md#lessons-learned).
138
+ Short version:
139
+
140
+ 1. **S2 first** (~24 h on M1 Max): full SoVITS v2ProTw finetune from
141
+ `s2Gv2Pro.pth`. 15 epochs.
142
+ 2. **S1 next** (~12-30 h): `s1_train_mps_arpa_freeze.py` from
143
+ `s1v3.ckpt`, ARPA-row freeze, warmup → cosine LR (peak 1e-2, end
144
+ 1e-4, 2000-step warmup, 40k-step decay). Critical patch: upstream
145
+ `lr_schedulers.py` had a hardcode locking every run to LR=0.002
146
+ regardless of yaml; that's now removed.
147
+ 3. **Sandhi-aligned labels are non-negotiable.** Training on
148
+ citation-tone POJ when the recordings have natural sandhi produces
149
+ a systematically mispronouncing model.
150
+ 4. **Embedding transplant** for the trilingual variant: copy rows
151
+ 0..731 from a clean `s1v3` back into the TW-finetuned ckpt.
152
+ Restores Mandarin without touching the trained TW rows.
153
+
154
+ ## License & credits
155
+
156
+ - License: **MIT** (matches upstream GPT-SoVITS).
157
+ - Upstream: [RVC-Boss/GPT-SoVITS](https://github.com/RVC-Boss/GPT-SoVITS).
158
+ - TW adaptation: [KaedeTai](https://github.com/KaedeTai).
159
+ - Acknowledgments: MoE 教育部臺灣閩南語常用詞辭典 example sentence
160
+ corpus, Common Voice `nan-tw` (Mozilla), BreezeASR-26 (MediaTek)
161
+ for TW ASR eval, linshoufan/whisper-small-nan-tw-pinyin for POJ
162
+ ASR.
163
+
164
+ ## Citation
165
+
166
+ If you find this useful in academic work, please cite the upstream
167
+ GPT-SoVITS and this fork:
168
+
169
+ ```bibtex
170
+ @misc{gpt-sovits-tw-2026,
171
+ title = {GPT-SoVITS Taiwanese (Hokkien) trilingual fork},
172
+ author = {KaedeTai},
173
+ year = {2026},
174
+ howpublished = {\url{https://huggingface.co/KaedeTai/gpt-sovits-tw}}
175
+ }
176
+ ```