File size: 724 Bytes
6e19f63
5b43964
989b57a
cb42996
5b43964
 
 
 
b867a1d
5b43964
cb42996
5b43964
989b57a
5b43964
 
 
70a718e
5b43964
e1c280b
5b43964
b54eb41
989b57a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
import subprocess
import threading

# Function to launch the new Gradio app
def launch_new_gradio_app():
    # Use subprocess to run the new Gradio app (new_gradio_app.py)
    subprocess.Popen(["python", "new_gradio_app.py"])

    return "New Gradio app is now running. Check the space to see the result!"

# Main Gradio UI with a button to start the new Gradio app
with gr.Blocks() as ui:
    gr.Markdown("### Dynamic Gradio App Loader")
    launch_button = gr.Button("Launch New Gradio App")
    status = gr.Textbox(label="Status")

    launch_button.click(launch_new_gradio_app, outputs=status)

# Launch the initial UI
if __name__ == "__main__":
    ui.launch(server_name="0.0.0.0", server_port=7860)