hans00 commited on
Commit
55295b7
·
verified ·
1 Parent(s): 2011f77

codec GGUFs: explicit sampling / flow defaults; README defaults & tuning table

Browse files

Adds chatterbox_s3g.flow.cfg_rate=0.7 and codec.lm.chatterbox.sampling.{temperature=0.8, top_p=1.0, min_p=0.05, repetition_penalty=1.2, cfg_weight=0.5} (tensors unchanged; n_timesteps stays 6). repetition_penalty is 1.2 instead of upstream's 2.0: upstream pairs 2.0 with its attention-based AlignmentStreamAnalyzer, absent with a llama.cpp backbone, and without it 2.0 runs to the frame limit on half the test sentences. README: text-input contract, defaults vs upstream table, measured trade-offs.

README.md CHANGED
@@ -84,24 +84,59 @@ Compared to the earlier release in this repo, the old `t3-*.gguf` (custom shape)
84
 
85
  `chatterbox-mtl-s3t.gguf` (F16, 237 MB) — needed for **voice-clone**, encodes a reference WAV into the speech token IDs that the codec_lm consumes when registering a custom speaker. Same weights as English Chatterbox.
86
 
87
- ## Flow decoding steps
88
-
89
- The `chatterbox-mtl-codec-*.gguf` files set `chatterbox_s3g.flow.n_timesteps = 6`
90
- (upstream S3Gen runs 10 Euler steps). The flow decoder is unrolled over steps × 2
91
- CFG passes, so this roughly halves the S3Gen decode time. Measured on CPU
92
- (Ryzen AI MAX+ 395, 12 threads) over 3 Chinese + 3 English sentences, text
93
- prepared as upstream `MTLTokenizer` does (`[zh]` + Cangjie codes, `[en]`):
94
- full synthesis 8.9 s -> 6.0 s per sentence, Whisper large-v3-turbo CER
95
- 1.2% -> 0.6%, CAMPPlus speaker cosine between the 6-step and the 10-step
96
- output 0.995. codec.cpp builds older than the
97
- configurable CFM schedule ignore the key and keep 10 steps. To get the
98
- upstream schedule back:
99
-
100
- ```
101
- tts-cli synthesize ... --override-kv chatterbox_s3g.flow.n_timesteps=int:10
102
- ```
103
-
104
- (or the `kv_overrides` argument of `codec_model_load_from_file_ext`).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  ## Inference shape
107
 
 
84
 
85
  `chatterbox-mtl-s3t.gguf` (F16, 237 MB) — needed for **voice-clone**, encodes a reference WAV into the speech token IDs that the codec_lm consumes when registering a custom speaker. Same weights as English Chatterbox.
86
 
87
+ ## Text input
88
+
89
+ The text passed to codec.cpp must already be prepared the way upstream
90
+ `MTLTokenizer.encode` prepares it (minus the BPE step, which codec.cpp does):
91
+ lowercase + NFKD, the language-specific conversion (`zh`: Cangjie codes from
92
+ `Cangjie5_TC.json`, `ja`: hiragana, ...), then the `[lang]` prefix, e.g.
93
+ `[en]hello there.` or `[zh][cj_o][cj_i]...`. Language handling is the
94
+ caller's job; codec.cpp does not add or infer the tag.
95
+
96
+ ## Defaults and tuning
97
+
98
+ All inference knobs are GGUF metadata in `chatterbox-mtl-codec-*.gguf`. Override
99
+ them per run with `tts-cli ... --override-kv KEY=TYPE:VALUE` (or the
100
+ `kv_overrides` argument of `codec_model_load_from_file_ext`); the T3 sampling
101
+ keys also have tts-cli flags.
102
+
103
+ | Parameter | Key (tts-cli flag) | This release | Upstream `mtl_tts.generate` | Notes |
104
+ |---|---|---|---|---|
105
+ | CFM Euler steps | `chatterbox_s3g.flow.n_timesteps` | **6** | 10 | see below |
106
+ | CFM classifier-free guidance | `chatterbox_s3g.flow.cfg_rate` | 0.7 | 0.7 | `0` skips the unconditional pass (~1.5x faster S3Gen) at a larger voice drift |
107
+ | T3 CFG weight | `codec.lm.chatterbox.sampling.cfg_weight` (`--cfg-weight`) | 0.5 | 0.5 | |
108
+ | T3 temperature | `codec.lm.chatterbox.sampling.temperature` (`--temp`) | 0.8 | 0.8 | |
109
+ | T3 min-p | `codec.lm.chatterbox.sampling.min_p` (`--min-p`) | 0.05 | 0.05 | |
110
+ | T3 top-p | `codec.lm.chatterbox.sampling.top_p` (`--top-p`) | 1.0 | 1.0 | |
111
+ | T3 repetition penalty | `codec.lm.chatterbox.sampling.repetition_penalty` (`--rep-penalty`) | **1.2** | 2.0 | see below |
112
+ | Emotion exaggeration | `codec.lm.chatterbox.builtin.emotion_adv` / `codec.speaker.emotion_default` | 0.5 | 0.5 | |
113
+
114
+ **Why 6 CFM steps.** The S3Gen flow decoder is unrolled over steps × 2 CFG
115
+ passes, so its cost is linear in the step count. Measured on CPU (Ryzen AI
116
+ MAX+ 395, 12 threads; S3Gen decode of 4 s of audio) and over 3 Chinese + 3
117
+ English sentences (Whisper large-v3-turbo CER, CAMPPlus speaker cosine of each
118
+ output against the 10-step output):
119
+
120
+ | Steps / CFG | S3Gen decode (4 s audio) | CER | Speaker cos vs 10 steps |
121
+ |---|---|---|---|
122
+ | 10 / 0.7 (upstream) | 6.3 s | 0.6% | 1 |
123
+ | **6 / 0.7 (default)** | **4.0 s** | **0.6%** | **0.994** |
124
+ | 4 / 0.7 | 2.9 s | 0.6% | 0.974 |
125
+ | 6 / 0 | 2.8 s | 0.6% | 0.955 |
126
+
127
+ 6 steps keeps the voice closest for the time saved. Use 4 steps (or CFG 0) when
128
+ latency matters more than speaker fidelity; set 10 to match upstream exactly.
129
+ On a Radeon 8060S (Vulkan) the 6-step S3Gen decode of 4 s of audio takes 0.94 s.
130
+
131
+ **Why repetition penalty 1.2.** Upstream's 2.0 is paired with its
132
+ `AlignmentStreamAnalyzer`, which reads T3's attention maps to force EOS once the
133
+ text has been spoken. A llama.cpp backbone exposes no attention maps, so that
134
+ guard is absent here; without it 2.0 kept 3 of the 6 test sentences generating
135
+ to the frame limit (CER 38%), while 1.2 (the English Chatterbox default) ends
136
+ every sentence at CER 0.6%. Raise it only together with a tight `--max-frames`.
137
+
138
+ codec.cpp builds older than the configurable CFM schedule / sampling metadata
139
+ ignore these keys and fall back to their built-in values.
140
 
141
  ## Inference shape
142
 
chatterbox-mtl-codec-f16.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:298c17e9d92c598830d6484972f42a59370dcc7f59d7e72a29d1b8cd4949c669
3
- size 335027136
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32a9ab055ec14b1fce2bfab9bb30d20d0ed3f3c679b2996449a77fda7a3046c7
3
+ size 335027456
chatterbox-mtl-codec-f32.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:60d0c5d1e812b07795f0e9a03ad19d96fe93e1f9b85a57f70f51419848705898
3
- size 604573408
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1893d2dc29fec44fb5ce23ab589edc5fbc659b0ba3a2a1f6c00c4c94f9f347a0
3
+ size 604573728
chatterbox-mtl-codec-q4_k_m.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7ecd66234d866a2757a06fce5a92a4cde6358f75174e6c74ef1eb90e7fa5ea1e
3
- size 189203456
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fc57022c82f74e61b56fdc2dcb0d605c43fb5582e3ecb52a7efbb2e363efa20
3
+ size 189203776
chatterbox-mtl-codec-q5_k_m.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8973eff338358ce86f7ff9aa7944ec5aeb82b9fc378cfd69a85a58779169b111
3
- size 201883776
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:615b290fffa24ea372490097fc0c61b2c45555fc1c06eeaaef990bf6caa90a45
3
+ size 201884096
chatterbox-mtl-codec-q8_0.gguf CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e8d5b8afbdc7b253f13b24f8901af4ee875223b9c0357f7a9aa667da5ca3e148
3
- size 239603136
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f612d01fb372a02aa4412979f7ea391999c1f5b51506c804fffb63f645834b72
3
+ size 239603456