-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: tags for jumpstart model package models #4061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c1157bd
f64ca6d
41a2113
e4fb3bc
0b1ce9f
15b20d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,13 +310,34 @@ def _is_valid_model_id_hook(): | |
|
||
super(JumpStartModel, self).__init__(**model_init_kwargs.to_kwargs_dict()) | ||
|
||
def _create_sagemaker_model(self, *args, **kwargs): # pylint: disable=unused-argument | ||
def _create_sagemaker_model( | ||
self, | ||
instance_type=None, | ||
accelerator_type=None, | ||
tags=None, | ||
serverless_inference_config=None, | ||
**kwargs, | ||
): | ||
"""Create a SageMaker Model Entity | ||
|
||
Args: | ||
args: Positional arguments coming from the caller. This class does not require | ||
any so they are ignored. | ||
|
||
instance_type (str): Optional. The EC2 instance type that this Model will be | ||
used for, this is only used to determine if the image needs GPU | ||
support or not. (Default: None). | ||
accelerator_type (str): Optional. Type of Elastic Inference accelerator to | ||
attach to an endpoint for model loading and inference, for | ||
example, 'ml.eia1.medium'. If not specified, no Elastic | ||
Inference accelerator will be attached to the endpoint. (Default: None). | ||
tags (List[dict[str, str]]): Optional. The list of tags to add to | ||
the model. Example: >>> tags = [{'Key': 'tagname', 'Value': | ||
'tagvalue'}] For more information about tags, see | ||
https://boto3.amazonaws.com/v1/documentation | ||
/api/latest/reference/services/sagemaker.html#SageMaker.Client.add_tags | ||
(Default: None). | ||
serverless_inference_config (sagemaker.serverless.ServerlessInferenceConfig): | ||
Optional. Specifies configuration related to serverless endpoint. Instance type is | ||
not provided in serverless inference. So this is used to find image URIs. | ||
(Default: None). | ||
kwargs: Keyword arguments coming from the caller. This class does not require | ||
any so they are ignored. | ||
""" | ||
|
@@ -347,10 +368,16 @@ def _create_sagemaker_model(self, *args, **kwargs): # pylint: disable=unused-ar | |
container_def, | ||
vpc_config=self.vpc_config, | ||
enable_network_isolation=self.enable_network_isolation(), | ||
tags=kwargs.get("tags"), | ||
tags=tags, | ||
) | ||
else: | ||
super(JumpStartModel, self)._create_sagemaker_model(*args, **kwargs) | ||
super(JumpStartModel, self)._create_sagemaker_model( | ||
instance_type=instance_type, | ||
accelerator_type=accelerator_type, | ||
tags=tags, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sanity check: will There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just confirming that in the previous behavior, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, if just to make sure on above, if it does maybe we just append the tags from kwargs |
||
serverless_inference_config=serverless_inference_config, | ||
**kwargs, | ||
) | ||
|
||
def deploy( | ||
self, | ||
|
Uh oh!
There was an error while loading. Please reload this page.