Spaces:
Sleeping
Sleeping
| 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) |