""" server/app.py — required entry point for multi-mode deployment. This module re-exports the FastAPI+Gradio app and provides the `main()` callable referenced by [project.scripts] → server = "server.app:main". """ import os import sys # Ensure the project root is on sys.path so all relative imports resolve. _ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if _ROOT not in sys.path: sys.path.insert(0, _ROOT) import uvicorn from app import app # noqa: F401 — re-export for `from server.app import app` def main() -> None: """Entry point invoked by `uv run server` or `python -m server.app`.""" uvicorn.run( "app:app", host="0.0.0.0", port=int(os.environ.get("PORT", 7860)), reload=False, ) if __name__ == "__main__": main()