@@ -238,7 +238,7 @@ def train(self, image, input_mode, input_config, role, job_name, output_config,
238
238
LOGGER .debug ('train request: {}' .format (json .dumps (train_request , indent = 4 )))
239
239
self .sagemaker_client .create_training_job (** train_request )
240
240
241
- def create_model (self , name , role , primary_container , supplemental_containers = None ):
241
+ def create_model (self , name , role , primary_container ):
242
242
"""Create an Amazon SageMaker ``Model``.
243
243
244
244
Specify the S3 location of the model artifacts and Docker image containing
@@ -253,36 +253,27 @@ def create_model(self, name, role, primary_container, supplemental_containers=No
253
253
primary_container (str or dict[str, str]): Docker image which defines the inference code.
254
254
You can also specify the return value of ``sagemaker.container_def()``, which is used to create
255
255
more advanced container configurations, including model containers which need artifacts from S3.
256
- supplemental_containers (list[str or dict[str, str]]): List of Docker images which define
257
- additional containers that need to be run in addition to the primary container (default: None).
258
- You can also specify the return values of ``sagemaker.container_def()``, which the API uses to create
259
- more advanced container configurations, including model containers which need artifacts from S3.
260
256
261
257
Returns:
262
258
str: Name of the Amazon SageMaker ``Model`` created.
263
259
"""
264
260
role = self .expand_role (role )
265
261
primary_container = _expand_container_def (primary_container )
266
- if supplemental_containers is None :
267
- supplemental_containers = []
268
- supplemental_containers = [_expand_container_def (sc ) for sc in supplemental_containers ]
269
262
LOGGER .info ('Creating model with name: {}' .format (name ))
270
263
LOGGER .debug ("create_model request: {}" .format ({
271
264
'name' : name ,
272
265
'role' : role ,
273
- 'primary_container' : primary_container ,
274
- 'supplemental_containers' : supplemental_containers
266
+ 'primary_container' : primary_container
275
267
}))
276
268
277
269
self .sagemaker_client .create_model (ModelName = name ,
278
270
PrimaryContainer = primary_container ,
279
- SupplementalContainers = supplemental_containers ,
280
271
ExecutionRoleArn = role )
281
272
282
273
return name
283
274
284
275
def create_model_from_job (self , training_job_name , name = None , role = None , primary_container_image = None ,
285
- model_data_url = None , env = {}, supplemental_containers = None ):
276
+ model_data_url = None , env = {}):
286
277
"""Create an Amazon SageMaker ``Model`` from a SageMaker Training Job.
287
278
288
279
Args:
@@ -296,8 +287,6 @@ def create_model_from_job(self, training_job_name, name=None, role=None, primary
296
287
model_data_url (str): S3 location of the model data (default: None). If None, defaults to
297
288
the ``ModelS3Artifacts`` of ``training_job_name``.
298
289
env (dict[string,string]): Model environment variables (default: {}).
299
- supplemental_containers (list[dict[str, str]]): A list of supplemental Docker containers
300
- (default: None). Defines the ``SupplementalContainers`` property on the created ``Model``.
301
290
302
291
Returns:
303
292
str: The name of the created ``Model``.
@@ -309,7 +298,7 @@ def create_model_from_job(self, training_job_name, name=None, role=None, primary
309
298
primary_container_image or training_job ['AlgorithmSpecification' ]['TrainingImage' ],
310
299
model_data_url = model_data_url or training_job ['ModelArtifacts' ]['S3ModelArtifacts' ],
311
300
env = env )
312
- return self .create_model (name , role , primary_container , supplemental_containers )
301
+ return self .create_model (name , role , primary_container )
313
302
314
303
def create_endpoint_config (self , name , model_name , initial_instance_count , instance_type ):
315
304
"""Create an Amazon SageMaker endpoint configuration.
0 commit comments