Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,28 @@ python scripts/train_voxcpm_finetune.py \

## 📚 More Information

### 🍎 macOS Support (Apple Silicon)

To run VoxCPM on macOS (Apple Silicon), we recommend following setup, using `uv`.
We use `uv` to strictly manage dependencies and avoid version conflicts (like incompatible `torch` and `torchcodec` versions) that can occur with standard `pip`.

You also need to install `ffmpeg` for audio processing:

```bash
brew install ffmpeg
```

Then, set up the Python environment:

```bash
uv sync
source .venv/bin/activate
```

VoxCPM will then automatically detect macOS and run in CPU mode with float32 precision to ensure stability.

> Running on CPU might be significantly slower than on GPU (CUDA). This mode is intended for Mac compatibility.

### 🌟 Community Projects
We're excited to see the VoxCPM community growing! Here are some amazing projects and features built by our community:
- **[ComfyUI-VoxCPM](https://github.com/wildminder/ComfyUI-VoxCPM)** A VoxCPM extension for ComfyUI.
Expand Down
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.10"
requires-python = ">=3.10,<3.14"
dependencies = [
"torch>=2.5.0",
"torchaudio>=2.5.0",
"torchcodec",
"torch>=2.5.0,<2.6.0; sys_platform == 'darwin'",
"torch>=2.5.0; sys_platform != 'darwin'",
"torchaudio>=2.5.0,<2.6.0; sys_platform == 'darwin'",
"torchaudio>=2.5.0; sys_platform != 'darwin'",
"torchcodec==0.2.0; sys_platform == 'darwin'",
"torchcodec; sys_platform != 'darwin'",
"transformers>=4.36.2",
"einops",
"gradio<6",
Expand Down
6 changes: 6 additions & 0 deletions src/voxcpm/model/voxcpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def __init__(
self.device = "mps"
else:
self.device = "cpu"

# [Fix] Force CPU on macOS to avoid MPS issues with bfloat16/complex ops
if sys.platform == "darwin":
print("Detected macOS environment. Forcing 'cpu' and 'float32' to ensure stability.", file=sys.stderr)
self.device = "cpu"
self.config.dtype = "float32"
print(f"Running on device: {self.device}, dtype: {self.config.dtype}", file=sys.stderr)

# Text-Semantic LM
Expand Down