humres-api / app.py
vaishnav019's picture
Pin huggingface_hub<0.25.0 to resolve Gradio HfFolder ImportError
162c9bb
Raw History Blame Contribute Delete
423 Bytes
import os
import gradio as gr
from main import app
with gr.Blocks(title="HumRes API") as demo:
gr.Markdown("# 🚀 HumRes API Server")
gr.Markdown("FastAPI Backend is running successfully.")
# Mount FastAPI app onto Gradio
app_ui = gr.mount_gradio_app(app, demo, path="/")
if __name__ == "__main__":
import uvicorn
port = int(os.environ.get("PORT", 7860))
uvicorn.run(app, host="0.0.0.0", port=port)