From 09ed480bc21b909fbc8ae261efca456d95ca2f7d Mon Sep 17 00:00:00 2001 From: Aleksandar Ivanovski Date: Thu, 6 Oct 2022 13:31:54 +0200 Subject: [PATCH] [DEV] feature/bytes-payload | Add bytes as payload --- clearml_serving/serving/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clearml_serving/serving/main.py b/clearml_serving/serving/main.py index 369aa4b..88b9ddc 100644 --- a/clearml_serving/serving/main.py +++ b/clearml_serving/serving/main.py @@ -5,7 +5,7 @@ import gzip from fastapi import FastAPI, Request, Response, APIRouter, HTTPException from fastapi.routing import APIRoute -from typing import Optional, Dict, Any, Callable +from typing import Optional, Dict, Any, Callable, Union from clearml import Task from clearml_serving.version import __version__ @@ -87,7 +87,7 @@ router = APIRouter( @router.post("/{model_id}/{version}") @router.post("/{model_id}/") @router.post("/{model_id}") -async def serve_model(model_id: str, version: Optional[str] = None, request: Dict[Any, Any] = None): +async def serve_model(model_id: str, version: Optional[str] = None, request: Union[bytes, Dict[Any, Any]] = None): try: return_value = processor.process_request( base_url=model_id,