Fix routing

This commit is contained in:
allegroai 2022-03-06 03:14:06 +02:00
parent a7eb36383c
commit 34e5a0b2c8
2 changed files with 5 additions and 2 deletions

View File

@ -79,6 +79,9 @@ router = APIRouter(
) )
# cover all routing options for model version `/{model_id}`, `/{model_id}/123`, `/{model_id}?version=123`
@router.post("/{model_id}/{version}")
@router.post("/{model_id}/")
@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: Dict[Any, Any] = None):
try: try:

View File

@ -17,14 +17,14 @@ The output will be a model created on the project "serving examples", by the nam
2. Create model endpoint: 2. Create model endpoint:
`clearml-serving --id <service_id> model add --engine triton --endpoint "test_model_pytorch" --preprocess "examples/pytorch/preprocess.py" --name "train pytorch model" --project "serving examples" `clearml-serving --id <service_id> model add --engine triton --endpoint "test_model_pytorch" --preprocess "examples/pytorch/preprocess.py" --name "train pytorch model" --project "serving examples"
--input-size 28 28 1 --input-name "INPUT__0" --input-type float32 --input-size 1 28 28 --input-name "INPUT__0" --input-type float32
--output-size -1 10 --output-name "OUTPUT__0" --output-type float32 --output-size -1 10 --output-name "OUTPUT__0" --output-type float32
` `
Or auto update Or auto update
`clearml-serving --id <service_id> model auto-update --engine triton --endpoint "test_model_pytorch_auto" --preprocess "examples/pytorch/preprocess.py" --name "train pytorch model" --project "serving examples" --max-versions 2 `clearml-serving --id <service_id> model auto-update --engine triton --endpoint "test_model_pytorch_auto" --preprocess "examples/pytorch/preprocess.py" --name "train pytorch model" --project "serving examples" --max-versions 2
--input-size 28 28 1 --input-name "INPUT__0" --input-type float32 --input-size 1 28 28 --input-name "INPUT__0" --input-type float32
--output-size -1 10 --output-name "OUTPUT__0" --output-type float32` --output-size -1 10 --output-name "OUTPUT__0" --output-type float32`
Or add Canary endpoint Or add Canary endpoint