Fails to generate with Turbo model on Apple Silicon, Float64 not supported
On Apple Silicon, when using the Turbo model, it will fail to generate the first chunk, prompting this error message, saying float64 is not supported by MPS. (There is no issue when using the original 500M model.):
2025-12-22 08:39:33 [ERROR] engine: Error during TTS synthesis: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
Traceback (most recent call last):
File "/path/to/Chatterbox-TTS-Server/engine.py", line 386, in synthesize
wav_tensor = chatterbox_model.generate(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/Chatterbox-TTS-Server/venv/lib/python3.11/site-packages/chatterbox/tts_turbo.py", line 262, in generate
self.prepare_conditionals(audio_prompt_path, exaggeration=exaggeration, norm_loudness=norm_loudness)
File "/path/to/Chatterbox-TTS-Server/venv/lib/python3.11/site-packages/chatterbox/tts_turbo.py", line 234, in prepare_conditionals
t3_cond_prompt_tokens, _ = s3_tokzr.forward([ref_16k_wav[:self.ENC_COND_LEN]], max_len=plen)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/to/Chatterbox-TTS-Server/venv/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/path/to/Chatterbox-TTS-Server/venv/lib/python3.11/site-packages/chatterbox/models/s3tokenizer/s3tokenizer.py", line 110, in forward
wav = wav.to(self.device)
^^^^^^^^^^^^^^^^^^^
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
2025-12-22 08:39:33 [ERROR] server: TTS engine failed to synthesize audio for chunk 1.
I tried muddling with the files and appeared to solve this error by forcing it to convert the audio to float32 s3tokenizer.py and voice_encoder.py.
In s3tokenizer.py, I changed line 110 to:
wav = wav.to(self.device, dtype=torch.float32)
In voice_encoder.py, line 242, I changed the mels.to(self.device) part to mels.to(self.device, dtype=torch.float32)
Now it can generate as expected.
Thank you very much for sharing the solution. I will see that this is added to the code soon.
Fixed in commit a67348a (server) and devnen/chatterbox-v2@cc03573 (fork). Thank you @jonas3245 for identifying the exact fix!
The changes force float32 dtype in s3tokenizer.py and voice_encoder.py when moving tensors to device, since MPS doesn't support float64.
This is handled two ways for maximum reliability:
- In the chatterbox-v2 fork — the fix is built in, so reinstalling chatterbox picks it up
- In start.py — an automatic post-install patch applies the same fix if the fork isn't used (e.g., upstream chatterbox)
To update: git pull && python start.py --reinstall
Closing, the Apple Silicon float64 fix has been on main since a67348a (with the chatterbox-v2 fork update in cc03573). Thank you @jonas3245 again for pinpointing the exact dtype cast sites. Please reopen if you still hit it on a clean install of current main.