Skip to content

model, mtmd: add chatterbox TTS support - #30993

Merged
ngxson merged 8 commits into
masterfrom
xsn/chatterbox
Nov 3, 2026
Merged

ngxson merged 8 commits into
masterfrom
xsn/chatterbox

Conversation

@ngxson

@ngxson ngxson commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Overview

Add support for chatterbox TTS model

This model is quite complicated, still WIP for now, but we're getting there

Requirements

@github-actions github-actions Bot added documentation Improvements or additions to documentation mtmd Related to multimodal functionality (video/image/audio) conversion labels Oct 22, 2026
@ngxson
ngxson marked this pull request as ready for review November 3, 2026 02:12
@ngxson
ngxson requested review from a team, CISC and ggerganov as code owners November 3, 2026 02:12
@ngxson

ngxson commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

@ServeurpersoCom should be ready for review

@github-actions github-actions Bot added the model Model specific label Nov 3, 2026
Comment thread conversion/chatterbox.py Resolved
Comment thread conversion/chatterbox.py Resolved
Comment thread conversion/chatterbox.py Resolved

@ServeurpersoCom ServeurpersoCom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Tested CUDA: both variants reconverted from the original ResembleAI checkpoints following the README, clean build, and every run ends on a natural EOS: Turbo with the default voice and with cloning, Multilingual V3 in French and English with the default voice and with cloning (several seeds), plus a Qwen3-TTS run to check that the doubled sequences don't break other models.

mtl-en-default.wav
mtl-fr-clone-s1.wav
mtl-fr-default.wav
turbo-clone.wav
turbo-default.wav

nonreg-qwen3tts.wav

fencerJP pushed a commit to fencerJP/llama-apu that referenced this pull request Nov 21, 2026
* add chatterbox TTS support

Co-authored-by: Pascal <[email protected]>

* add built-in voice support

* rm redundant code

* clean up

* clean up 2

* Apply batched suggestions from code review

Co-authored-by: Sigbjørn Skjæret <[email protected]>

* improve

---------

Co-authored-by: Pascal <[email protected]>
Co-authored-by: Sigbjørn Skjæret <[email protected]>
amangupta-tether added a commit to tetherto/qvac-fabric-llm.cpp that referenced this pull request Nov 23, 2026
The Inkling 2 DSpark export indexes mtp.safetensors and the target's
model.safetensors with index_local_tensors(prefix), which temp-12032
does not have yet. This is the conversion/base.py part of upstream
b976279 (ggml-org#30993), unchanged.

Assisted-by: Claude Opus 5.5
amangupta-tether added a commit to tetherto/qvac-fabric-llm.cpp that referenced this pull request Nov 26, 2026
* convert : export the Inkling 2 DSpark drafter (from ggml-org#32218)

(cherry picked from commit 6ed4222)

* dspark : Inkling 2 DSpark drafter on temp-12032 (port of ggml-org#32218)

Ports the C++ side of ggml-org#32218 at e4b1cb5 (upstream
commits 8ccecab "init cpp side" and eacd398 "handle temp > 0" by
Xuan-Son Nguyen, e4b1cb5 by Piotr Wilkin) to the DFlash code of
temp-12032, which predates the upstream DFlash refactor (ggml-org#32016):

- src/models/dflash.cpp: the hparam, tensor and graph changes of
  upstream dspark.cpp and dflash.cpp go into llama_model_dflash and its
  dual-mode graph<false>. The injection mixes the raw target features per
  layer when the draft has no fc (ctx_mix) and returns f_rnn in h_nextn.
  The token path builds the anchor-first block from mask_embd and takes
  the rnn state as embd_state. The markov head gets the f_rnn input, the
  w2 bias, the softcap after the bias and the in-graph draws.
- The block uses the SWA window of its anchor through the existing
  build_dspark_block_mask of the DSV4.1 draft (now a template over the
  attention input), instead of upstream's llm_attn_mask::block_uniform.
- common/speculative.cpp: the single DFlash driver keeps the f_rnn rows
  the same way it keeps the LiliCorr context features (lilicorr_* storage
  renamed ctx_*), builds the block state rows and reads the draws for
  probabilistic drafting.
- llama-arch, gguf-py, hparams, llama-batch, inkling2 and inkling2-loop
  taps, docs: as upstream.

Assisted-by: Claude Opus 5.5

* spec : count the loop visits of a looped model in the draft check

The draft check compares the target layers of a DFlash draft with
<arch>.block_count. Inkling 2 Mini runs layers [loop.start, loop.end)
loop.count times and its layer inputs are indexed by visit (24 + 2 x 12
= 48), so its DSpark draft, which reads visit 41, was refused.

Assisted-by: Claude Opus 5.5

* convert : split index_local_tensors out of index_tensors

The Inkling 2 DSpark export indexes mtp.safetensors and the target's
model.safetensors with index_local_tensors(prefix), which temp-12032
does not have yet. This is the conversion/base.py part of upstream
b976279 (ggml-org#30993), unchanged.

Assisted-by: Claude Opus 5.5

* dspark : create the Inkling 2 draft tensors only for drafts that have them

test-llama-archs creates every optional tensor of its DFlash test model,
which has no block size: mask_embd of dflash_block_size - 1 rows then asked
for a 4 TB buffer. mask_embd is now created for DSpark drafts with a block
of 2 or more tokens only (as upstream), and the per-layer ctx_mix tensors
only when the draft has them.

Assisted-by: Claude Opus 5.5

* spec : decode the draft blocks in groups that fit the draft ubatch

A draft with a markov context (Inkling 2 DSpark) decodes its full trained
block for each drafting sequence, and the block attention is non-causal, so
the decode has to fit one ubatch. With a small --spec-draft-n-ubatch, or with
several sequences, the single decode of all blocks could exceed it and hit
the non-causal assertion in llama_decode.

The blocks are now decoded in groups of whole blocks that fit n_ubatch (and
n_batch), and the drafts of each group are read back before the next decode.
When all blocks fit, this is the single decode as before. The context
creation checks that one block fits and names the size otherwise.

The docs list Inkling 2 among the supported DSpark drafters.

Assisted-by: Claude Opus 5.5

* spec : clear startup error for a draft that cannot read the target's head, name the real batch options

An EAGLE3 or DFlash/DSpark draft without its own token embeddings or output
head reads the target's. With --spec-draft-device none and the target's head
in a CUDA0 buffer, the draft's scheduler had no backend for that matmul and
the context failed while reserving its graph, which the server reported as a
model loading error. The draft context now checks, once its backends exist,
that one of them can read the buffer of each borrowed tensor, and otherwise
fails with: "the dflash draft uses the target model's output head, which is in
a CUDA0 buffer that none of the draft's devices can read; run the draft on a
device that can, such as the target's GPU (not --spec-draft-device none)".
CPU drafting with a GPU target is not supported for these drafts.

The block-size check named --spec-draft-n-batch, which does not exist. The
draft inherits the logical batch (-b / --batch-size), and only the physical
batch has a draft option, so the error now names --batch-size for a causal
draft and --spec-draft-n-ubatch (and --batch-size if it is smaller) for a
non-causal one.

Assisted-by: Claude Opus 5.5

---------

Co-authored-by: Xuan Son Nguyen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conversion documentation Improvements or additions to documentation model Model specific mtmd Related to multimodal functionality (video/image/audio)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants