From ac40a86400b8a8c62ad3723e56e7579b536111e1 Mon Sep 17 00:00:00 2001 From: Addie Rudy Date: Tue, 28 Nov 2023 21:40:59 -0500 Subject: [PATCH] fix(genai_core): handling bad FMs (improved finetuned) --- lib/shared/layers/python-sdk/python/genai_core/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/shared/layers/python-sdk/python/genai_core/models.py b/lib/shared/layers/python-sdk/python/genai_core/models.py index 78ccd6af3..2772710aa 100644 --- a/lib/shared/layers/python-sdk/python/genai_core/models.py +++ b/lib/shared/layers/python-sdk/python/genai_core/models.py @@ -103,8 +103,8 @@ def list_bedrock_finetuned_models(): } for model in bedrock_custom_models # Exclude embeddings and stable diffusion models - if model.get("inputModalities", None) != None - and model.get("outputModalities", None) != None + if "inputModalities" in model + and "outputModalities" in model and Modality.EMBEDDING.value not in model.get("outputModalities", []) and Modality.IMAGE.value not in model.get("outputModalities", []) ]