moshi_mlx 支持 TTS-0.75B
1. lm.py — text_out_vocab_size reads the wrong config field
# was:
text_out_vocab_size=data["text_card"],
# changed to:
text_out_vocab_size=data["text_card_out"],Error before patch: Expected shape (8000, 1024) but received shape (5, 1024) for parameter text_linear.weight
2. run_tts.py — Mimi audio tokenizer loaded with the wrong codebook count
# was:
audio_tokenizer = models.mimi.Mimi(models.mimi_202407(generated_codebooks))
# changed to:
audio_tokenizer = models.mimi.Mimi(models.mimi_202407(32))The 0.75B checkpoint only uses 16 generated codebooks downstream, but Mimi itself needs to be initialized with the full 32 to load its weights without missing-key errors; codebooks get truncated later in get_prefix.
3. tts.py, get_prefix() — dtype overflow + wrong codebook count
prefix = self.mimi.encode(mx.array(wav)[None])[0, :, :-2].astype(mx.int64) # was uint32
prefix = prefix[: self.lm.n_q] # truncate 32 -> 16 codebooksError before patch: ValueError: Converting -1 to uint32 would result in overflow — token_ids.zero is -1 for this checkpoint (no CFG distillation), and MLX won't implicitly cast -1 into the uint32 dtype the encoded prefix defaults to.
内容来源: kyutai-labs/moshi