Skip to content

Commit ef042d9

Browse files
committed
update types and var names
1 parent 032cb80 commit ef042d9

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/sagemaker/jumpstart/cache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ def get_hub_model(self, hub_model_arn: str) -> JumpStartModelSpecs:
467467
hub_model_arn (str): Arn for the Hub model to get specs for
468468
"""
469469

470-
specs, _ = self._content_cache.get(JumpStartCachedContentKey(HubDataType.MODEL, hub_model_arn))
471-
return specs.formatted_content
470+
details, _ = self._content_cache.get(JumpStartCachedContentKey(HubDataType.MODEL, hub_model_arn))
471+
return details.formatted_content
472472

473473
def get_hub(self, hub_arn: str) -> Dict[str, Any]:
474474
"""Return descriptive info for a given Hub
@@ -477,8 +477,8 @@ def get_hub(self, hub_arn: str) -> Dict[str, Any]:
477477
hub_arn (str): Arn for the Hub to get info for
478478
"""
479479

480-
manifest, _ = self._content_cache.get(JumpStartCachedContentKey(HubDataType.HUB, hub_arn))
481-
return manifest.formatted_content
480+
details, _ = self._content_cache.get(JumpStartCachedContentKey(HubDataType.HUB, hub_arn))
481+
return details.formatted_content
482482

483483
def clear(self) -> None:
484484
"""Clears the model ID/version and s3 cache."""

src/sagemaker/jumpstart/curated_hub/curated_hub.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# language governing permissions and limitations under the License.
1313
from typing import Optional, Dict, Any
1414

15-
import boto3
16-
1715
from sagemaker.session import Session
1816

1917
from sagemaker.jumpstart.curated_hub.constants import DEFAULT_CLIENT_CONFIG
@@ -26,13 +24,8 @@ def __init__(self, hub_name: str, region: str, session: Optional[Session]):
2624
self.hub_name = hub_name
2725
self.region = region
2826
self.session = session
29-
self._s3_client = self._get_s3_client()
3027
self._sm_session = session or Session()
3128

32-
def _get_s3_client(self) -> Any:
33-
"""Returns an S3 client."""
34-
return boto3.client("s3", region_name=self._region, config=DEFAULT_CLIENT_CONFIG)
35-
3629
def describe_model(self, model_name: str, model_version: str = "*") -> Dict[str, Any]:
3730
"""Returns descriptive information about the Hub Model"""
3831

src/sagemaker/jumpstart/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ def __init__(
991991
data_type: JumpStartContentDataType,
992992
id_info: str,
993993
) -> None:
994-
"""Instantiates JumpStartCachedS3ContentKey object.
994+
"""Instantiates JumpStartCachedContentKey object.
995995
996996
Args:
997997
data_type (JumpStartContentDataType): JumpStart content data type.
@@ -1014,7 +1014,7 @@ def __init__(
10141014
],
10151015
md5_hash: Optional[str] = None,
10161016
) -> None:
1017-
"""Instantiates JumpStartCachedS3ContentValue object.
1017+
"""Instantiates JumpStartCachedContentValue object.
10181018
10191019
Args:
10201020
formatted_content (Union[Dict[JumpStartVersionedModelId, JumpStartModelHeader],

0 commit comments

Comments
 (0)