Views
No views yet
1pip install mlx-audio
2
3# Zero-shot
4python -m mlx_audio.tts.generate --model mlx-community/VoxCPM2-8bit --text "Hello world" --verbose
5
6# Voice design
7python -m mlx_audio.tts.generate --model mlx-community/VoxCPM2-8bit \
8 --text "Hello world" \
9 --instruct "A young woman, gentle and sweet voice"
10
11# Voice cloning
12python -m mlx_audio.tts.generate --model mlx-community/VoxCPM2-8bit \
13 --text "Hello world" \
14 --ref_audio speaker.wav --ref_text "reference text"1from mlx_audio.tts import load_model
2
3model = load_model("mlx-community/VoxCPM2-8bit")
4
5# Generate
6for result in model.generate(
7 text="Hello, this is VoxCPM2 on Apple Silicon.",
8 inference_timesteps=7,
9 cfg_value=2.0,
10):
11 print(f"Duration: {result.audio_duration}")| Variant | Size | RTF (7 timesteps) |
|---|---|---|
| bf16 | 4.96 GB | 0.48x |
| 8-bit | 3.23 GB | 0.85x |
| 4-bit | 2.30 GB | 0.90x |