Skip to content

[Bug]ChatterBox 23-Lang Russian model produces gibberish (MPS) / IndexError (CPU) — token/vocab mismatch #345

Description

@vlenchik

Environment*

  • Platform: macOS, Apple Silicon (M-series)
  • ComfyUI: Desktop app, version 0.31.0
  • Engine: ChatterBox Official 23-Lang Engine, language = Russian

Summary
Generating Russian speech with the ChatterBox 23-Lang engine produces two different failure modes depending on device setting, both pointing to the same root cause: the Russian model's generated speech tokens exceed the vocabulary size of the s3gen flow decoder's embedding table.

On device=cpu: Hard crash with IndexError during generation.

On device=mps: No crash — generation "succeeds" and returns audio of the expected duration, but the output is unintelligible gibberish (correct prosody/expression, but no real phonetic content in any language). This is consistent with MPS's embedding kernel skipping bounds-checking that CPU enforces — the same out-of-range token issue, just silently corrupting output instead of raising an exception.

Steps to reproduce

  1. Add "ChatterBox Official 23-Lang Engine" node, set language to Russian
  2. Add "TTS Text" node, connect Engine output
  3. Provide a clean reference voice sample (tested with two different samples — a personal recording and a separate professional voice sample — same result both times, ruling out reference audio as the cause)
  4. Provide matching Russian reference text transcript
  5. Set device=cpu → crash. Set device=mps → completes but output is gibberish.

CPU traceback
IndexError: index out of range in self
File ".../engines/chatterbox/models/s3gen/flow.py", line 218, in inference
token = self.input_embedding(torch.clamp(token, min=0)) * mask
File ".../torch/nn/functional.py", line 2567, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self

Full traceback available on request — happy to paste more context.

Notes

  • Re-downloaded the Russian model files fresh (t3_cfg.safetensors, tokenizer.json, s3gen.safetensors, ve.safetensors, conds.pt) to rule out a corrupted download — same result.
  • Ruled out text encoding (confirmed clean UTF-8 Cyrillic) and reference audio format (44.1kHz mono WAV, clean recording) as causes.
  • Suspect the Russian language pack's tokenizer/vocab doesn't match the s3gen flow model's embedding table size for this checkpoint.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions