hans00 commited on
Commit
5cc731b
Β·
verified Β·
1 Parent(s): 21e0c34

feat: native codec_lm layout (codec.gguf bundles cond_enc + text_emb + speech_pos_emb)

Browse files
.gitattributes CHANGED
@@ -56,3 +56,9 @@ t3-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
56
  t3-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
57
  t3-q6_k.gguf filter=lfs diff=lfs merge=lfs -text
58
  t3-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
56
  t3-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
57
  t3-q6_k.gguf filter=lfs diff=lfs merge=lfs -text
58
  t3-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
59
+ chatterbox-mtl-codec-f16.gguf filter=lfs diff=lfs merge=lfs -text
60
+ chatterbox-mtl-codec-f32.gguf filter=lfs diff=lfs merge=lfs -text
61
+ chatterbox-mtl-codec-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
62
+ chatterbox-mtl-codec-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
63
+ chatterbox-mtl-codec-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
64
+ chatterbox-mtl-s3t.gguf filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -16,7 +16,7 @@ language:
16
  - ko
17
  - ms
18
  - nl
19
- - no
20
  - pl
21
  - pt
22
  - ru
@@ -30,131 +30,81 @@ tags:
30
  - chatterbox
31
  - chatterbox-multilingual
32
  - text-to-speech
 
33
  base_model: ResembleAI/chatterbox
34
  ---
35
 
36
  # Chatterbox-Multilingual T3 GGUF
37
 
38
- GGUF conversions of [Resemble AI's Chatterbox multilingual T3](https://huggingface.co/ResembleAI/chatterbox) (the `t3_mtl23ls_v3.safetensors` variant in the upstream repo β€” 23-language coverage with the same arch as the original English T3).
39
 
40
- The Chatterbox stack is split into two halves so each can run inside the
41
- runtime that owns it:
42
 
43
- - **LLM-part (T3)** β€” text + conditioning to discrete speech token IDs,
44
- run by stock **llama.cpp** (`llama` arch).
45
- - **Codec-part (S3G / S3T)** β€” discrete speech tokens to/from 24 kHz
46
- PCM, run by **[codec.cpp](https://github.com/mybigday/codec.cpp)**.
47
 
48
- Only payload speech token IDs (`0..6560`) cross the boundary between the
49
- two runtimes.
50
 
51
  ## Files
52
 
53
- ### LLM-part (T3 multilingual)
54
-
55
- `t3-<quant>.gguf` is a stock `llama` arch GGUF holding only T3's
56
- 30-layer Llama backbone (hidden 1024, MLP 4096, 16 heads, RoPE ΞΈ=10000)
57
- plus the speech-side embedding/head (`speech_emb` β†’ `token_embd`,
58
- `speech_head` β†’ `output`). The vocabulary contains 8194 entries
59
- (`<|speech_0|>` … `<|speech_8193|>`), every one marked as a `CONTROL`
60
- (special) token so llama.cpp's sampler / stop / grammar paths recognise
61
- each speech ID. `BOS = 6561` (`start_speech_token`), `EOS = 6562`
62
- (`stop_speech_token`); add_bos / add_eos default to false.
63
-
64
- The multilingual variant differs from the English `t3_cfg` only in the
65
- text-side embedding/head shape (`text_vocab = 2454` vs `704`) and the
66
- text tokenizer; the speech side is unchanged.
67
-
68
- | File | Size |
69
- | ----------------- | ------- |
70
- | `t3-f32.gguf` | 2.0 GB |
71
- | `t3-f16.gguf` | 993 MB |
72
- | `t3-q8_0.gguf` | 528 MB |
73
- | `t3-q6_k.gguf` | 407 MB |
74
- | `t3-q5_1.gguf` | 373 MB |
75
- | `t3-q5_k_m.gguf` | 352 MB |
76
- | `t3-q5_k_s.gguf` | 343 MB |
77
- | `t3-q5_0.gguf` | 343 MB |
78
- | `t3-q4_1.gguf` | 312 MB |
79
- | `t3-q4_k_m.gguf` | 300 MB |
80
- | `t3-q4_k_s.gguf` | 284 MB |
81
- | `t3-q4_0.gguf` | 282 MB |
82
- | `t3-q3_k_l.gguf` | 263 MB |
83
- | `t3-q3_k_m.gguf` | 241 MB |
84
- | `t3-q3_k_s.gguf` | 217 MB |
85
- | `t3-q2_k.gguf` | 185 MB |
86
-
87
- `t3-extras.gguf` (`chatterbox_t3` arch, ~31 MB) carries the T3 wrapper
88
- tensors that aren't part of the Llama backbone β€” text embedding/head,
89
- learned positional embeddings, and the conditioning encoder
90
- (perceiver / speaker / emotion fc). The host application reads these
91
- through the gguf API to build the prompt prefix:
92
-
93
- - `t3.text_emb.weight`, `t3.text_head.weight`
94
- - `t3.text_pos_emb.weight`, `t3.speech_pos_emb.weight`
95
- - `t3.cond_enc.*` (perceiver attention/ff, `spkr_enc`, `emotion_adv_fc`)
96
-
97
- The same file also exposes T3 metadata
98
- (`chatterbox_t3.text_vocab_size = 2454`,
99
- `chatterbox_t3.start_speech_token`, `speech_cond_prompt_len`, …)
100
- needed to drive the LLM.
101
-
102
- ### Text tokenizer
103
-
104
- `mtl_tokenizer.json` (~67 KB) β€” the multilingual BPE tokenizer used to
105
- turn input text into the IDs that index `t3.text_emb`. Copy this file
106
- into the same directory as `t3-extras.gguf` and load it via your
107
- preferred HF-tokenizer-compatible parser.
108
-
109
- ### Codec-part β€” S3G decoder
110
-
111
- `codec[-<quant>].gguf` (`chatterbox_s3g` arch) β€” Chatterbox S3Gen
112
- flow-matching decoder + HiFi-GAN vocoder, with built-in conditioning
113
- (`conds.pt`) baked in. The S3G weights are language-independent and
114
- shared verbatim with the English Chatterbox release.
115
-
116
- | File | Size |
117
- | ------------------- | ------- |
118
- | `codec-f32.gguf` | 535 MB |
119
- | `codec-f16.gguf` | 268 MB |
120
- | `codec-q8_0.gguf` | 196 MB |
121
- | `codec-q5_k_m.gguf` | 167 MB |
122
- | `codec-q4_k_m.gguf` | 158 MB |
123
-
124
- ### Codec-part β€” S3T tokenizer
125
-
126
- `s3t.gguf` (`chatterbox_s3t` arch, F16, 236 MB) β€” S3 audio tokenizer
127
- (24 kHz mel front-end, 25 Hz token rate, codebook 6561). Only needed
128
- for voice-cloning / reference-token paths. Same weights as the English
129
- release.
130
-
131
- ## Boundary contract
132
-
133
- - token rate: 25 Hz, `n_q = 1`
134
- - payload codebook size: 6561 (IDs `0..6560`)
135
- - `start_speech_token = 6561`, `stop_speech_token = 6562`
136
- - speech vocabulary in T3: 8194 (`speech_tokens_dict_size`)
137
- - text vocabulary in T3: 2454 (`text_tokens_dict_size`)
138
- - encode sample rate: 16 kHz, decode sample rate: 24 kHz
139
-
140
- ## Notes
141
-
142
- - **Loading the LLM-part:** stock `llama.cpp` (β‰₯ b8095) loads
143
- `t3-*.gguf` directly. Because the model is `no_vocab`, the host
144
- application is responsible for: tokenizing text via
145
- `mtl_tokenizer.json`, looking up `t3.text_emb` for the text-side
146
- prefix, building the conditioning prefix from `t3.cond_enc.*`, adding
147
- the matching learned positional embeddings, and feeding the assembled
148
- embedding sequence to `llama_decode`. After the prefix is consumed,
149
- generation proceeds autoregressively over speech tokens (which is
150
- what the speech-side embedding/head in `t3-*.gguf` are for).
151
- - **Quantization** uses `llama-quantize` for the T3 backbone and
152
- codec.cpp's converter (with a fix that recognises `.weight` names) for
153
- the codec-part.
154
- - Source weights: `t3_mtl23ls_v3.safetensors` and `s3gen.safetensors`
155
- from `ResembleAI/chatterbox`. The English T3 (`t3_cfg.safetensors`)
156
- lives in [`hans00/Chatterbox-TTS-GGUF`](https://huggingface.co/hans00/Chatterbox-TTS-GGUF).
157
- - **Supported languages**: Arabic, Danish, German, Greek, English,
158
- Spanish, Finnish, French, Hebrew, Hindi, Italian, Japanese, Korean,
159
- Malay, Dutch, Norwegian, Polish, Portuguese, Russian, Swedish,
160
- Swahili, Turkish, Chinese (23 total).
 
16
  - ko
17
  - ms
18
  - nl
19
+ - 'no'
20
  - pl
21
  - pt
22
  - ru
 
30
  - chatterbox
31
  - chatterbox-multilingual
32
  - text-to-speech
33
+ - codec-lm
34
  base_model: ResembleAI/chatterbox
35
  ---
36
 
37
  # Chatterbox-Multilingual T3 GGUF
38
 
39
+ End-to-end GGUF conversion of [ResembleAI's Chatterbox multilingual T3](https://huggingface.co/ResembleAI/chatterbox) (`t3_mtl23ls_v3.safetensors` β€” 23-language coverage).
40
 
41
+ This release adopts the **native codec_lm split** used by CSM / Qwen3-TTS / MOSS-TTSD:
 
42
 
43
+ - **Backbone (`chatterbox-mtl-t3-<quant>.gguf`)** β€” stock `llama` arch GGUF of Chatterbox T3's Llama-520M `tfmr.*` weights (30 layers, hidden 1024, 16 heads, head_dim=64, MLP 4096, llama3 RoPE scaling, rope_theta=500000, vocab placeholder = `tokenizer.ggml.model = "none"`). Runs in stock **llama.cpp** with `embeddings=true`.
44
+ - **Codec + codec_lm (`chatterbox-mtl-codec-<quant>.gguf`)** β€” Chatterbox S3G (flow-matching decoder + HiFi-GAN vocoder) bundled with the T3 LM-adaptor side (audio embed table, speech head, text embed/head, learned positional embeddings, cond encoder weights). Runs in [codec.cpp](https://github.com/mybigday/codec.cpp) as a `parallel_heads_delay` codec_lm with `n_cb=1`.
45
+ - **S3T tokenizer (`chatterbox-mtl-s3t.gguf`)** β€” speech tokenizer needed when registering a custom voice from a reference WAV.
 
46
 
47
+ Compared to the earlier release in this repo, the old `t3-*.gguf` (custom shape) and `t3-extras.gguf` are gone β€” everything the host runtime needs to drive the LM adaptor is now bundled into `chatterbox-mtl-codec-*.gguf` and exposed through codec.cpp's `codec_lm` API.
 
48
 
49
  ## Files
50
 
51
+ ### Backbone (`chatterbox-mtl-t3-<quant>.gguf`)
52
+
53
+ | File | Size |
54
+ | ----------------------------------- | ------- |
55
+ | `chatterbox-mtl-t3-f32.gguf` | 1.9 GB |
56
+ | `chatterbox-mtl-t3-f16.gguf` | 961 MB |
57
+ | `chatterbox-mtl-t3-bf16.gguf` | 961 MB |
58
+ | `chatterbox-mtl-t3-q8_0.gguf` | 511 MB |
59
+ | `chatterbox-mtl-t3-q6_k.gguf` | 395 MB |
60
+ | `chatterbox-mtl-t3-q5_1.gguf` | 361 MB |
61
+ | `chatterbox-mtl-t3-q5_k_m.gguf` | 340 MB |
62
+ | `chatterbox-mtl-t3-q5_k_s.gguf` | 331 MB |
63
+ | `chatterbox-mtl-t3-q5_0.gguf` | 331 MB |
64
+ | `chatterbox-mtl-t3-q4_1.gguf` | 301 MB |
65
+ | `chatterbox-mtl-t3-q4_k_m.gguf` | 289 MB |
66
+ | `chatterbox-mtl-t3-q4_k_s.gguf` | 273 MB |
67
+ | `chatterbox-mtl-t3-q4_0.gguf` | 271 MB |
68
+ | `chatterbox-mtl-t3-q3_k_l.gguf` | 254 MB |
69
+ | `chatterbox-mtl-t3-q3_k_m.gguf` | 232 MB |
70
+ | `chatterbox-mtl-t3-q3_k_s.gguf` | 207 MB |
71
+ | `chatterbox-mtl-t3-q2_k.gguf` | 177 MB |
72
+
73
+ ### Codec + codec_lm (`chatterbox-mtl-codec-<quant>.gguf`)
74
+
75
+ | File | Size |
76
+ | ----------------------------------- | ------- |
77
+ | `chatterbox-mtl-codec-f32.gguf` | 572 MB |
78
+ | `chatterbox-mtl-codec-f16.gguf` | 317 MB |
79
+ | `chatterbox-mtl-codec-q8_0.gguf` | 226 MB |
80
+ | `chatterbox-mtl-codec-q5_k_m.gguf` | 190 MB |
81
+ | `chatterbox-mtl-codec-q4_k_m.gguf` | 178 MB |
82
+
83
+ ### S3T speech tokenizer
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
+ ## Inference shape
88
+
89
+ Per-frame AR loop, single-codebook `parallel_heads_delay`:
90
+
91
+ ```
92
+ backbone (Llama-520M, embeddings=true) hidden h
93
+ β†’ codec_lm_step_begin(state, h)
94
+ β†’ codec_lm_step_logits(0) β†’ sample speech-token β†’ codec_lm_step_push_code
95
+ β†’ codec_lm_step_finish β†’ codes[1]
96
+ β†’ codec_lm_compose_audio_embd(codes) + speech_pos_emb[step] β†’ next-step embedding
97
+ β†’ feed via b.embd; loop until stop_speech_token (6562)
98
+ ```
99
+
100
+ Prompt prefix assembly (text + cond) lives inside codec.cpp's chatterbox path; the host application doesn't directly touch `lm.chatterbox.*` tensors.
101
+
102
+ ## Sources
103
+
104
+ - Upstream model: [`ResembleAI/chatterbox`](https://huggingface.co/ResembleAI/chatterbox) (`t3_mtl23ls_v3.safetensors`)
105
+ - Conversion tooling: [`mybigday/codec.cpp`](https://github.com/mybigday/codec.cpp) (`prep_chatterbox_t3` + `lm_adaptor/chatterbox.py` + `ChatterboxS3GConverter` with `lm_source`)
106
+ - Inference runtime: [`mybigday/llama.rn`](https://github.com/mybigday/llama.rn)
107
+
108
+ ## Supported languages
109
+
110
+ Arabic, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Dutch, Norwegian, Polish, Portuguese, Russian, Swedish, Swahili, Turkish, Chinese (23 total).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
chatterbox-mtl-codec-f16.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a4f7de5b7a417367fe0b989978a662ee4d90aeea22b1e325fd5c81f3d117517b
3
+ size 332015424
chatterbox-mtl-codec-f32.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:942698751489e18ba359dd1cb77d9e03e160803d48492cd932ba5db3ce4440bc
3
+ size 598727264
chatterbox-mtl-codec-q4_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8baafb80db857e895fbc9da1a11a483cc3f191a165da81fcef9c05d76c1bef5f
3
+ size 186191744
chatterbox-mtl-codec-q5_k_m.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70ba679f51069e8ae3a15fc4493b785025d40f1e4a84fd09d8043982ba2e477b
3
+ size 198872064
chatterbox-mtl-codec-q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25f6ae81c6226f7111043eda5ff653b8953260db07aee12655e2c8eb6a97714b
3
+ size 236591424
chatterbox-mtl-s3t.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26592ce171dd40bb54468a32dd9a3b697e15bfc23ebc8f8d218e34c3962e69c4
3
+ size 247487280