""" 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() import gradio as gr from webui import render_tab_content as render_svs_tab from webui_svc import render_tab_content as render_svc_tab with gr.Blocks(title="SoulX-Singer", theme=gr.themes.Default()) as page: gr.HTML( '