feat: Add automatic CPU/float32 fallback for macOS and updated docs #162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mac specific suggestions
Hi! Sharing my experience getting VoxCPM running on my Mac (Apple Silicon). It's an awesome project, but I hit a few bumps with the default setup on macOS.
The main blocker seems to be the MPS (Mac GPU). When running normally, it crashed with:
What worked for me:
Forcing CPU & float32: I had to explicitly force the device to
cpuand change the dtype tofloat32manually in bothvoxcpm.pyand the downloaded model'sconfig.json. My change should be able to detect mac specifically and not enforce this for CUDA devices.Installing FFmpeg: I needed to run
brew install ffmpegfortorchaudio/torchcodecto load correctly (pretty standard, but might be worth noting in the readme).PyTorch & TorchCodec: I use uv and noticed that edge PyTorch versions (like 2.9.x installed by uv) conflict with
torchcodec, throwing:The PyTorch version (2.9.1) is not compatible with this version of TorchCodec. I had to pin back to stable versions (e.g., 2.5.1). The updated pyproject.toml file specifies these versions that worked for me on mac devices.Just thought I'd drop this hear in case other Mac users run into the same walls! There might be some performance differences of course.
This might not be the best way, but worked for me. Let me know if you have other suggestions.
Thanks for the great work!