From b1f5cd833e07592d53eb61a3ec62f325e3855e7e Mon Sep 17 00:00:00 2001 From: Malav Shastri Date: Mon, 24 Jun 2024 17:04:24 -0400 Subject: [PATCH 1/2] fix: list_models() for python3.8 --- src/sagemaker/jumpstart/hub/hub.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sagemaker/jumpstart/hub/hub.py b/src/sagemaker/jumpstart/hub/hub.py index 1545fe3a36..aa6904d107 100644 --- a/src/sagemaker/jumpstart/hub/hub.py +++ b/src/sagemaker/jumpstart/hub/hub.py @@ -184,13 +184,16 @@ def list_models(self, clear_cache: bool = True, **kwargs) -> Dict[str, Any]: **{ "hub_name": self.hub_name, "hub_content_type": HubContentType.MODEL_REFERENCE.value, + **kwargs } - | kwargs ) hub_model_summaries = self._list_and_paginate_models( - **{"hub_name": self.hub_name, "hub_content_type": HubContentType.MODEL.value} - | kwargs + **{ + "hub_name": self.hub_name, + "hub_content_type": HubContentType.MODEL.value, + **kwargs + } ) response["hub_content_summaries"] = hub_model_reference_summaries + hub_model_summaries response["next_token"] = None # Temporary until pagination is implemented From 6b9f390d9dcb44f5c47bb8d41a07af6cef85c2b7 Mon Sep 17 00:00:00 2001 From: Malav Shastri Date: Mon, 24 Jun 2024 23:05:41 -0400 Subject: [PATCH 2/2] fix linting --- src/sagemaker/jumpstart/hub/hub.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sagemaker/jumpstart/hub/hub.py b/src/sagemaker/jumpstart/hub/hub.py index aa6904d107..d208220965 100644 --- a/src/sagemaker/jumpstart/hub/hub.py +++ b/src/sagemaker/jumpstart/hub/hub.py @@ -184,15 +184,15 @@ def list_models(self, clear_cache: bool = True, **kwargs) -> Dict[str, Any]: **{ "hub_name": self.hub_name, "hub_content_type": HubContentType.MODEL_REFERENCE.value, - **kwargs + **kwargs, } ) hub_model_summaries = self._list_and_paginate_models( **{ - "hub_name": self.hub_name, + "hub_name": self.hub_name, "hub_content_type": HubContentType.MODEL.value, - **kwargs + **kwargs, } ) response["hub_content_summaries"] = hub_model_reference_summaries + hub_model_summaries