Skip to content

Commit

Permalink
One line update to avoid missing field in api response causing backen…
Browse files Browse the repository at this point in the history
…d failing to start.
  • Loading branch information
ryuzio committed May 8, 2024
1 parent e7ce0fc commit af771e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/model_deployments/cohere_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def list_models(cls) -> List[str]:
return []

models = response.json()["models"]
return [model["name"] for model in models if "chat" in model["endpoints"]]
return [
model["name"]
for model in models
if model.get("endpoints") and "chat" in model["endpoints"]
]

@classmethod
def is_available(cls) -> bool:
Expand Down

0 comments on commit af771e0

Please sign in to comment.