smjain commited on
Commit
3b7d6d1
·
verified ·
1 Parent(s): 8a8e37b

Create gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +15 -0
gradio_app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import subprocess
3
+ import threading
4
+
5
+ def run_flask():
6
+ subprocess.run(["python", "app.py"])
7
+
8
+ # Run Flask in a separate thread
9
+ threading.Thread(target=run_flask, daemon=True).start()
10
+
11
+ def gradio_interface():
12
+ return "Flask is running in the background. Access API endpoints as configured."
13
+
14
+ iface = gr.Interface(fn=gradio_interface, inputs=None, outputs="text")
15
+ iface.launch()