dhineshkmar commited on
Commit
bd7dc13
·
verified ·
1 Parent(s): 44c2c84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -8
app.py CHANGED
@@ -1,12 +1,26 @@
1
- import os
2
- import sys
 
3
 
4
- # Set port
5
- port = int(os.environ.get("PORT", 7860))
6
-
7
- # Import and run Flask app
8
  from neurosight_app_with_auth import app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  if __name__ == "__main__":
11
- # Don't load AI models on startup (comment out model loading)
12
- app.run(host="0.0.0.0", port=port, debug=False)
 
1
+ import gradio as gr
2
+ import subprocess
3
+ import time
4
 
5
+ # Start Flask app
6
+ def start_flask():
7
+ subprocess.Popen(["python", "-c", """
 
8
  from neurosight_app_with_auth import app
9
+ app.run(host='0.0.0.0', port=5000, debug=False)
10
+ """])
11
+ time.sleep(5) # Wait for Flask to start
12
+ return "Flask app started on port 5000"
13
+
14
+ # Gradio interface
15
+ with gr.Blocks() as demo:
16
+ gr.Markdown("# 🧠 NeuroSight - Brain Disease Detection")
17
+ gr.Markdown("Access your app at: http://localhost:5000")
18
+
19
+ start_btn = gr.Button("Start NeuroSight")
20
+ status = gr.Textbox(label="Status")
21
+ start_btn.click(start_flask, outputs=status)
22
+
23
+ gr.HTML('<iframe src="http://localhost:5000" width="100%" height="800px"></iframe>')
24
 
25
  if __name__ == "__main__":
26
+ demo.launch(server_name="0.0.0.0", server_port=7860)