Spaces:
Sleeping
Sleeping
Upload 21 files
Browse files- app/controllers/embed_controller.py +1 -1
- app/main.py +12 -0
app/controllers/embed_controller.py
CHANGED
|
@@ -45,7 +45,7 @@ async def embed_batch(req: BatchRequest, _: Any = Depends(api_key_guard)):
|
|
| 45 |
|
| 46 |
|
| 47 |
@router.get("/health")
|
| 48 |
-
async def health_check(
|
| 49 |
"""Verify server status and model readiness."""
|
| 50 |
return {
|
| 51 |
"status": "healthy",
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
@router.get("/health")
|
| 48 |
+
async def health_check() -> Dict[str, Any]:
|
| 49 |
"""Verify server status and model readiness."""
|
| 50 |
return {
|
| 51 |
"status": "healthy",
|
app/main.py
CHANGED
|
@@ -99,8 +99,20 @@ async def add_process_time_header(request: Request, call_next):
|
|
| 99 |
logger.info(f"Request: {request.method} {request.url.path} - Completed in {process_time:.2f}ms")
|
| 100 |
return response
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
app.include_router(embed_router)
|
| 103 |
|
| 104 |
|
|
|
|
| 105 |
if __name__ == "__main__":
|
| 106 |
uvicorn.run("app.main:app", host=settings.HOST, port=settings.PORT, workers=settings.WORKERS)
|
|
|
|
| 99 |
logger.info(f"Request: {request.method} {request.url.path} - Completed in {process_time:.2f}ms")
|
| 100 |
return response
|
| 101 |
|
| 102 |
+
@app.get("/", tags=["status"])
|
| 103 |
+
async def root():
|
| 104 |
+
"""Root endpoint providing server status and documentation links."""
|
| 105 |
+
return {
|
| 106 |
+
"status": "online",
|
| 107 |
+
"message": "BGE-M3 Multilingual Embedding Server is running.",
|
| 108 |
+
"version": app.version,
|
| 109 |
+
"docs_url": "/docs",
|
| 110 |
+
"health_check": "/embed/health"
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
app.include_router(embed_router)
|
| 114 |
|
| 115 |
|
| 116 |
+
|
| 117 |
if __name__ == "__main__":
|
| 118 |
uvicorn.run("app.main:app", host=settings.HOST, port=settings.PORT, workers=settings.WORKERS)
|