[Frontend] Parallelize preprocessing within the same request for pooling models online serving. (#49153)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-07-22 10:56:23 +00:00
committed by GitHub
parent d6dbdb9b0d
commit 61c9ef986a
17 changed files with 538 additions and 820 deletions
@@ -17,8 +17,11 @@ from .serving import ServingPooling
router = APIRouter()
def pooling(request: Request) -> ServingPooling | None:
return request.app.state.serving_pooling
def pooling(request: Request) -> ServingPooling:
handler = getattr(request.app.state, "serving_pooling", None)
if handler is None:
raise NotImplementedError("The model does not support Pooling API")
return handler
@router.post(
@@ -33,7 +36,4 @@ def pooling(request: Request) -> ServingPooling | None:
@load_aware_call
async def create_pooling(request: PoolingRequest, raw_request: Request):
handler = pooling(raw_request)
if handler is None:
raise NotImplementedError("The model does not support Pooling API")
return await handler(request, raw_request)