Skip to content

Commit eae499c

Browse files
author
Chuyang Deng
committed
initialize endpoint config and model names within predictor
1 parent 55193a2 commit eae499c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ CHANGELOG
66
==========
77

88
* doc-fix: Remove incorrect parameter for EI TFS Python README
9+
* feature: ``Predictor``: delete SageMaker model
10+
* feature: ``Pipeline``: delete SageMaker model
911

1012
1.18.3.post1
1113
============

src/sagemaker/predictor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,15 @@ def delete_model(self):
133133
for model_name in self._model_names:
134134
self.sagemaker_session.delete_model(model_name)
135135

136-
def _get_model_names(self):
136+
def _get_endpoint_config_desc(self):
137137
endpoint_desc = self.sagemaker_session.sagemaker_client.describe_endpoint(EndpointName=self.endpoint)
138138
self._endpoint_config_name = endpoint_desc['EndpointConfigName']
139139
endpoint_config = self.sagemaker_session.sagemaker_client.describe_endpoint_config(
140140
EndpointConfigName=self._endpoint_config_name)
141+
return endpoint_config
142+
143+
def _get_model_names(self):
144+
endpoint_config = self._get_endpoint_config_desc()
141145
production_variants = endpoint_config['ProductionVariants']
142146
return map(lambda d: d['ModelName'], production_variants)
143147

0 commit comments

Comments
 (0)