Skip to content

chatterbox: keep the component and its voices across languages that share a T3 - #1285

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
magnus-dev-melin:chatterbox-keep-component-across-languages
Nov 14, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
magnus-dev-melin:chatterbox-keep-component-across-languages

Conversation

@magnus-dev-melin

Copy link
Copy Markdown
Contributor

Chatterbox cloning rebuilt its whole component (T3, tokenizer, voice encoder, S3 tokenizer, CAMPPlus, S3Gen) and emptied chatterbox.conditionals_cache_slots on every language change, though the component depends on the language only through the T3 it loads: English, or multilingual for every other language. A server voicing one speaker into several listener languages paid that on every switch, and more cache slots could not help. The session now remembers whether its component runs the multilingual T3 and rebuilds only when that changes; switches among the multilingual languages keep the component and its prepared voices (the cache key already includes the language). Model-local; no framework or option changes. docs/tts.md notes that the slots now hold a voice per language across such switches.

Depends on #1284 for its outputs: a voice prepared on a kept component goes through the CAMPPlus runner again, which on main gives a different embedding after the first; with #1284 every output below equals main's.

Validation (macOS, M1 Max, Metal, chatterbox_q8_0, legacy server, OMP_NUM_THREADS=4, seed 7, one 14 s reference). Ten /v1/audio/speech cloning requests through de, da, de, sv, de, en, de, da, sv, de, against a main build (a91e36b) and this branch with #1284:

seconds per request main this branch
a multilingual language again, 3 slots (de at 2, 4, 9) 4.6–4.7 2.5
a multilingual language again, 1 slot (default) 4.6–4.8 3.2
a multilingual language for the first time 4.5–4.8 3.1–3.3
to or from English 4.4–4.7 4.5–4.7
  • Every WAV equalled main's for the same language (SHA-256), in every position, with 1 and with 3 slots.
  • RSS stayed within the same range (main 1461–1637 MB, this branch 1226–1599 MB): there is still one component at a time.
  • model_spec_system_test, cli_request_options_test and tools/check_loader_catalog_sync.py pass.

Not measured: CUDA/Vulkan (the change is backend-independent), and the parallel runtime beyond building. Keeping both T3 variants loaded, so English switches cost nothing either, would trade about a T3's memory for it; not done here.

@0xShug0
0xShug0 merged commit 6f979b9 into 0xShug0:main Nov 14, 2026
7 checks passed
@0xShug0

0xShug0 commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@magnus-dev-melin Thanks! PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants