Files
Kevin Gabeci 14cc279bd9 feat: Add Apple Silicon MPS support
Enable HeartMuLa to run on Apple Silicon Macs using Metal Performance Shaders (MPS).

Changes:
- Add MPS device detection in model_manager.py
- Fix KV cache setup context manager for MPS compatibility
- Fix hardcoded device="cuda" default in HeartCodec
- Fix .type() usage that breaks on MPS (use .to(dtype=) instead)
- Add MPS memory cleanup (torch.mps.empty_cache())
- Add MPS seed setting for reproducibility
- Auto-disable 4-bit quantization on non-CUDA devices (bitsandbytes requirement)
- Detect actual model device after loading to handle fallbacks

Tested on M-series Mac with PyTorch 2.10.0, generates full-length audio successfully.
2026-01-23 17:28:31 +01:00
..