fix: refact logic

This commit is contained in:
2025-12-31 17:38:32 +08:00
parent 6ac50f7d2f
commit 35928c2484
17 changed files with 678 additions and 738 deletions

View File

@@ -15,7 +15,7 @@ settings = get_settings()
async def lifespan(app: FastAPI):
"""Application lifespan handler for startup/shutdown."""
# Startup: Load models
init_layout_detector(model_path=settings.doclayout_model_path)
init_layout_detector()
yield
@@ -37,3 +37,9 @@ app.include_router(api_router, prefix=settings.api_prefix)
async def health_check():
"""Health check endpoint."""
return {"status": "healthy"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8053)