from flask import Flask, render_template | |
import gradio as gr | |
import threading | |
app = Flask(__name__) | |
# Route to serve the HTML page | |
def home(): | |
return render_template("re.html") # Ensure file is in "templates" folder | |
# Function to run Gradio UI separately | |
def run_gradio(): | |
gr.Interface(lambda: "Gradio App Running!", inputs=[], outputs="text").launch(share=True) | |
if __name__ == "__main__": | |
threading.Thread(target=run_gradio).start() | |
app.run(host="0.0.0.0", port=7860, debug=True) # Port should be 7860 |