feat(matching): rank with semantic embeddings and explain matches by evidence
This commit is contained in:
1 parent
facc1789b1
commit
24b64d698a
215 files changed
+16951
-327
No files matched your search
@@ -1,6 +1,7 @@
|
||||
from fastapi import APIRouter, Response, status
|
||||
from fastapi import APIRouter, Request, Response, status
|
||||
|
||||
from lincodex_ml.api.models import MLHealthResponse, MLReadinessResponse
|
||||
from lincodex_ml.inference.runtime import EmbeddingRuntime, RuntimeState
|
||||
|
||||
router = APIRouter(tags=["health"])
|
||||
|
||||
@@ -28,6 +29,11 @@ async def get_healthz() -> MLHealthResponse:
|
||||
},
|
||||
summary="Check whether an inference runtime is available.",
|
||||
)
|
||||
async def get_readyz(response: Response) -> MLReadinessResponse:
|
||||
async def get_readyz(request: Request, response: Response) -> MLReadinessResponse:
|
||||
# Ready only after the model is loaded and a warm-up encode finished;
|
||||
# a disabled or failed runtime stays not ready.
|
||||
runtime: EmbeddingRuntime = request.app.state.embedding_runtime
|
||||
if runtime.state is RuntimeState.READY:
|
||||
return MLReadinessResponse(status="ready")
|
||||
response.status_code = status.HTTP_503_SERVICE_UNAVAILABLE
|
||||
return MLReadinessResponse(status="not_ready")
|
||||
Reference in new issue
Block a user