Spaces:
Sleeping
Sleeping
File size: 802 Bytes
bd7dc13 44c2c84 bd7dc13 596a0cb bd7dc13 596a0cb bd7dc13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import gradio as gr
import subprocess
import time
# Start Flask app
def start_flask():
subprocess.Popen(["python", "-c", """
from neurosight_app_with_auth import app
app.run(host='0.0.0.0', port=5000, debug=False)
"""])
time.sleep(5) # Wait for Flask to start
return "Flask app started on port 5000"
# Gradio interface
with gr.Blocks() as demo:
gr.Markdown("# 🧠 NeuroSight - Brain Disease Detection")
gr.Markdown("Access your app at: http://localhost:5000")
start_btn = gr.Button("Start NeuroSight")
status = gr.Textbox(label="Status")
start_btn.click(start_flask, outputs=status)
gr.HTML('<iframe src="http://localhost:5000" width="100%" height="800px"></iframe>')
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=7860) |