File size: 838 Bytes
86020e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""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('<iframe src="/studio/app.html" title="StepAudio 3 Music Studio" style="position:fixed;inset:0;width:100%;height:100%;border:0;z-index:100;background:white"></iframe>')
    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()