Instructions to use openbmb/VoxCPM-0.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VoxCPM
How to use openbmb/VoxCPM-0.5B with VoxCPM:
import soundfile as sf from voxcpm import VoxCPM model = VoxCPM.from_pretrained("openbmb/VoxCPM-0.5B") wav = model.generate( text="VoxCPM is an innovative end-to-end TTS model from ModelBest, designed to generate highly expressive speech.", prompt_wav_path=None, # optional: path to a prompt speech for voice cloning prompt_text=None, # optional: reference text cfg_value=2.0, # LM guidance on LocDiT, higher for better adherence to the prompt, but maybe worse inference_timesteps=10, # LocDiT inference timesteps, higher for better result, lower for fast speed normalize=True, # enable external TN tool denoise=True, # enable external Denoise tool retry_badcase=True, # enable retrying mode for some bad cases (unstoppable) retry_badcase_max_times=3, # maximum retrying times retry_badcase_ratio_threshold=6.0, # maximum length restriction for bad case detection (simple but effective), it could be adjusted for slow pace speech ) sf.write("output.wav", wav, 16000) print("saved: output.wav") - Notebooks
- Google Colab
- Kaggle
Mac mps support?
Does this have mps acceleration?
Not yet, but we will support it as soon as possible.
What are the incompatibility issues preventing MPS Support for oxCPM-0.5B?
What are the incompatibility issues preventing MPS Support for oxCPM-0.5B?
It looks like PyTorch has some issues with GQA support when using MPS. We are still working on finding a solution.
Thanks! that matches my experience in converting the model to coreml where SDPA/GQA on MPS produce artifacts.
The Mitigation I put in place in converting to coreml was to enable eager attention with a flag of export VOXCPM_FORCE_EAGER_ATTENTION=1 to force float32 eager attention path, which avoided SDPA anomalies on MPS. I also used float32 on MPS end-to-end to improve numerical stability (instead of bf16/fp16)
@pylotlight We've updated the code to support MPS inference. Please try cloning the repository to install it and then test whether you can run inference using MPS.
I just tested this on an M3 pro chip and it worked great. 13-15 it/s