fix(backend): retry runaway generations on the Chatterbox MLX backend

The qwen configs already set retries_runaway on MLX, with the reason in a comment:
mlx-audio can continue past an EOS miss and emit silence followed by codec noise.
The Chatterbox MLX backend added in this PR hits the same failure and did not have
the guard wired.

Observed on an M4 Max with a cloned pt-BR profile: a 145 character sentence took
18.0s and returned 5.3s of audio for text worth about 8s, and a short reply came
back as an endless hiss. With retries_runaway enabled the same sentence takes 3.4s
and returns the full 7.4s of speech.
This commit is contained in:
Charles Hasse
2026-10-04 00:25:58 +00:00
committed by capy-ai-staging[bot]
parent ad5d64c0a3
commit 502123a943
+7 -1
View File
@@ -294,7 +294,8 @@ def _get_non_qwen_tts_configs() -> list[ModelConfig]:
# Chatterbox multilingual follows the same backend-aware split as Qwen: the MLX # Chatterbox multilingual follows the same backend-aware split as Qwen: the MLX
# backend loads pre-converted weights, so the download must match the backend that # backend loads pre-converted weights, so the download must match the backend that
# will consume it. # will consume it.
if get_backend_type() == "mlx": on_mlx = get_backend_type() == "mlx"
if on_mlx:
chatterbox_repo = "mlx-community/chatterbox-multilingual-v3" chatterbox_repo = "mlx-community/chatterbox-multilingual-v3"
chatterbox_size_mb = 2600 chatterbox_size_mb = 2600
else: else:
@@ -317,6 +318,11 @@ def _get_non_qwen_tts_configs() -> list[ModelConfig]:
hf_repo_id=chatterbox_repo, hf_repo_id=chatterbox_repo,
size_mb=chatterbox_size_mb, size_mb=chatterbox_size_mb,
needs_trim=True, needs_trim=True,
# Same EOS miss the qwen configs guard against: on mlx-audio the decoder can run past
# the end of the sentence and emit silence followed by codec noise, which reaches the
# listener as an endless hiss. Retrying the affected text as smaller chunks is the
# existing remedy; it just was not wired for this engine.
retries_runaway=on_mlx,
languages=[ languages=[
"zh", "zh",
"en", "en",