"""Host the original studio inside the managed Gradio runtime.""" import spaces import gradio as gr from server import app @spaces.GPU(duration=1) def _noop(): """Register the runtime; music generation calls only the remote API.""" return None with gr.Blocks() as demo: gr.HTML('') button = gr.Button(visible=False) button.click(_noop, inputs=None, outputs=None, api_visibility="private") if __name__ == "__main__": running_app, _, _ = demo.launch(server_name="0.0.0.0", server_port=7860, prevent_thread_lock=True, ssr_mode=False) running_app.router.routes[0:0] = app.router.routes demo.block_thread()