We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45c7433 commit 5389974Copy full SHA for 5389974
pkg/workloads/cortex/serve/serve.py
@@ -21,9 +21,9 @@
21
import threading
22
import math
23
import asyncio
24
-from typing import Union, Any
+from typing import Any
25
26
-from fastapi import FastAPI
+from fastapi import Body, FastAPI
27
from fastapi.exceptions import RequestValidationError
28
from starlette.requests import Request
29
from starlette.responses import Response
@@ -147,7 +147,7 @@ def apply_cors_headers(request: Request, response: Response):
147
148
149
@app.post("/predict")
150
-def predict(request: Union[dict, list, Any], debug=False):
+def predict(request: Any = Body(..., media_type="application/json"), debug=False):
151
api = local_cache["api"]
152
predictor_impl = local_cache["predictor_impl"]
153
0 commit comments