Skip to content

fix: make SoulX-Podcast run on macOS (MPS/CPU) - #65

Open
gu20241212-crypto wants to merge 1 commit into
Soul-AILab:mainfrom
gu20241212-crypto:main
Open

fix: make SoulX-Podcast run on macOS (MPS/CPU)#65
gu20241212-crypto wants to merge 1 commit into
Soul-AILab:mainfrom
gu20241212-crypto:main

Conversation

@gu20241212-crypto

Copy link
Copy Markdown

Summary

  • make inference device selection adaptive (cuda / mps / cpu) instead of hardcoded CUDA
  • remove CUDA-only tensor/model moves in SoulXPodcast core pipeline
  • make HF engine dtype/device initialization compatible with Apple Silicon
  • auto-fallback to hf engine when vllm/CUDA is unavailable
  • guard CUDA seed call in random-seed utility
  • add requirements.macos.txt for macOS-compatible dependency install

Why

Current code path fails on macOS (Apple Silicon) due to CUDA hardcoding (.cuda(), CUDA-only assumptions in engine setup), causing runtime errors such as Torch not compiled with CUDA enabled.

Validation

  • local syntax check passed via python -m py_compile
  • end-to-end TTS generation succeeded on macOS using:
    • cli/tts.py with model pretrained_models/SoulX-Podcast-1.7B
    • output wav files generated successfully (24kHz PCM)

@gu20241212-crypto

Copy link
Copy Markdown
Author

Validation notes (macOS Apple Silicon):

  • Environment: macOS + Apple Silicon (MPS available, CUDA unavailable).
  • Goal: verify this patch fixes CUDA hardcoding and enables successful inference on macOS.

Commands used:

cd /Users/GUGU/SoulX_Podcast/SoulX-Podcast
export PYTHONPATH=$PWD
/Users/GUGU/SoulX_Podcast/.venv/bin/python cli/tts.py \
  --prompt_text "喜欢攀岩、徒步、滑雪的语言爱好者。" \
  --dialect_prompt "" \
  --prompt_audio example/audios/female_mandarin.wav \
  --text "你好,这是一次短句测试。" \
  --model_path pretrained_models/SoulX-Podcast-1.7B \
  --output_path outputs/mandarin_tts_macos_fix_short.wav \
  --seed 7

Observed result:

  • Inference completed successfully.
  • Output wav written: outputs/mandarin_tts_macos_fix_short.wav
  • Audio info: 24kHz, mono, PCM_16, ~2.80s.

Also verified a longer sample generation completed successfully (~11.36s output).

Compatibility expectation:

  • CUDA path remains available when CUDA exists.
  • On non-CUDA devices (e.g. macOS/MPS), runtime now uses adaptive device selection and avoids CUDA-only code paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant