Spaces:
Running on Zero
Running on Zero
Serve FastAPI directly without Gradio to fix port 7861 conflict on HF Spaces
Browse filesFiles changed (4)
- README.md-1
- app.py+3-23
- app/server.py+9
- requirements.txt-2
3 unmodified lines456789103 unmodified linescolorFrom: bluecolorTo: indigosdk: gradiosdk_version: 5.16.0app_file: app.pypinned: false---3 unmodified lines4567893 unmodified linescolorFrom: bluecolorTo: indigosdk: gradioapp_file: app.pypinned: false---
6 unmodified lines7891011121314151617181920212223242526272829303132333435366 unmodified linesif str(ROOT_DIR) not in sys.path:sys.path.insert(0, str(ROOT_DIR))import gradio as grfrom app.server import app as fastapi_app# Create a clean status dashboard for visitors on Hugging Facewith gr.Blocks(title="Hybrid Semantic ATS Engine") as demo:gr.Markdown("# ⚡ Scalable Hybrid Semantic ATS Engine")gr.Markdown("This Space provides the high-performance NLP & Machine Learning retrieval ""and candidate scoring backend for the ATS Application.")with gr.Row():gr.Markdown("### ✅ System Status: **Online & Ready**")with gr.Accordion("API Endpoints", open=True):gr.Markdown("- `POST /invocations`: MLflow ResponsesAgent candidate evaluation & ranking\n""- `POST /api/files/upload`: PyMuPDF layout-aware resume parsing\n""- `GET /health`: Engine health check\n""- `GET /docs`: OpenAPI interactive documentation")# Mount Gradio onto the existing FastAPI application at /status so / is free or at /app = gr.mount_gradio_app(fastapi_app, demo, path="/")if __name__ == "__main__":import uvicornport = int(os.environ.get("PORT", 7860))uvicorn.run("app:app", host="0.0.0.0", port=port, reload=False)6 unmodified lines789101112131415166 unmodified linesif str(ROOT_DIR) not in sys.path:sys.path.insert(0, str(ROOT_DIR))# Expose app for ASGI runners (uvicorn app:app or uvicorn app.server:app)from app.server import app # noqa: F401if __name__ == "__main__":import uvicornport = int(os.environ.get("PORT", 7860))uvicorn.run("app.server:app", host="0.0.0.0", port=port, reload=False)
39 unmodified lines40414243444539 unmodified linesadapter = ATSScreeningAdapter()parser = ResumeParserService()@app.get("/health")def health():return {"status": "healthy", "service": "Hybrid Semantic ATS"}39 unmodified lines40414243444546474849505152535439 unmodified linesadapter = ATSScreeningAdapter()parser = ResumeParserService()@app.get("/")def root():return {"status": "healthy","service": "Hybrid Semantic ATS Engine","docs": "/docs","health": "/health"}@app.get("/health")def health():return {"status": "healthy", "service": "Hybrid Semantic ATS"}
1234567fastapi>=0.110.0uvicorn>=0.28.0gradio>=5.16.0huggingface_hub<1.0.0pydantic>=2.5.0pydantic-settings>=2.2.0pymupdf>=1.24.012345fastapi>=0.110.0uvicorn>=0.28.0pydantic>=2.5.0pydantic-settings>=2.2.0pymupdf>=1.24.0
README.md-1
app.py+3-23
app/server.py+9
requirements.txt-2