first commit

This commit is contained in:
Nathan Kim 2023-11-09 22:07:19 -08:00
parent 8f10d1a3e3
commit ee92c9c8b6

View file

@ -109,14 +109,14 @@ class Router:
if len(self.healthy_deployments) > 0:
for item in self.healthy_deployments:
if item[0]["model_name"] == model: # first one in queue will be the one with the most availability
return item
return item or item[0]
else:
potential_deployments = []
for item in self.model_list:
if item["model_name"] == model:
potential_deployments.append(item)
item = random.choice(potential_deployments)
return item
return item or item[0]
raise ValueError("No models available.")