SoulX-Singer / app.py
multimodalart's picture
Fix ZeroGPU nested @spaces.GPU causing CUDA failure 35
930ae2b
"""
Hugging Face Space entry point for SoulX-Singer.
Downloads pretrained models from the Hub if needed, then launches the Gradio app.
"""
import os
from pathlib import Path
# Set matplotlib backend before any imports that might use it (required for headless environments)
import matplotlib
matplotlib.use('Agg') # Use non-interactive backend
from ensure_models import ensure_pretrained_models
ROOT = Path(__file__).resolve().parent
if __name__ == "__main__":
os.chdir(ROOT)
ensure_pretrained_models()
from webui import render_interface
page = render_interface()
page.queue()
page.launch(
server_name="0.0.0.0",
server_port=int(os.environ.get("PORT", "7860")),
share=True,
)