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.