fix(router.py): fix int logic

This commit is contained in:
Krrish Dholakia 2023-12-29 20:41:56 +05:30
parent cf91e49c87
commit 2fc264ca04
3 changed files with 11 additions and 3 deletions

View file

@ -1546,9 +1546,11 @@ class Router:
############## Available Deployments passed, we find the relevant item #################
else:
## check if min deployment is a string, if so, cast it to int
if isinstance(min_deployment, str):
min_deployment = int(min_deployment)
for m in healthy_deployments:
if isinstance(min_deployment, str) and isinstance(
m["model_info"]["id"], int
):
min_deployment = int(min_deployment)
if m["model_info"]["id"] == min_deployment:
return m
self.print_verbose(f"no healthy deployment with that id found!")