Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
from flask import Flask,
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
app = Flask(__name__)
|
5 |
|
6 |
-
# Route to serve HTML
|
7 |
@app.route("/")
|
8 |
-
def
|
9 |
-
return
|
10 |
|
11 |
-
#
|
12 |
def run_gradio():
|
13 |
gr.Interface(lambda: "Gradio App Running!", inputs=[], outputs="text").launch(share=True)
|
14 |
|
15 |
if __name__ == "__main__":
|
16 |
-
|
17 |
-
|
18 |
-
app.run(host="0.0.0.0", port=7860)
|
|
|
1 |
+
from flask import Flask, render_template
|
2 |
import gradio as gr
|
3 |
+
import threading
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
|
7 |
+
# Route to serve HTML page
|
8 |
@app.route("/")
|
9 |
+
def home():
|
10 |
+
return render_template("re.html") # Flask will load from templates folder
|
11 |
|
12 |
+
# Function to run Gradio separately
|
13 |
def run_gradio():
|
14 |
gr.Interface(lambda: "Gradio App Running!", inputs=[], outputs="text").launch(share=True)
|
15 |
|
16 |
if __name__ == "__main__":
|
17 |
+
threading.Thread(target=run_gradio).start()
|
18 |
+
app.run(host="0.0.0.0", port=5000, debug=True) # Change port if needed
|
|