Skip to content

Commit d236194

Browse files
hardianlawivikas0203
authored andcommitted
Add variant_name kwarg
1 parent ff0d9ae commit d236194

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/sagemaker/huggingface/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def deploy(
200200
deserializer=None,
201201
accelerator_type=None,
202202
endpoint_name=None,
203+
variant_name="AllTraffic",
203204
tags=None,
204205
kms_key=None,
205206
wait=True,
@@ -251,6 +252,8 @@ def deploy(
251252
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
252253
endpoint_name (str): The name of the endpoint to create (default:
253254
None). If not specified, a unique endpoint name will be created.
255+
variant_name (string): The ``VariantName`` of this production variant
256+
(default: 'AllTraffic').
254257
tags (List[dict[str, str]]): The list of tags to attach to this
255258
specific endpoint.
256259
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -308,6 +311,7 @@ def deploy(
308311
deserializer,
309312
accelerator_type,
310313
endpoint_name,
314+
variant_name,
311315
tags,
312316
kms_key,
313317
wait,

src/sagemaker/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ def deploy(
10231023
deserializer=None,
10241024
accelerator_type=None,
10251025
endpoint_name=None,
1026+
variant_name="AllTraffic",
10261027
tags=None,
10271028
kms_key=None,
10281029
wait=True,
@@ -1074,6 +1075,8 @@ def deploy(
10741075
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
10751076
endpoint_name (str): The name of the endpoint to create (default:
10761077
None). If not specified, a unique endpoint name will be created.
1078+
variant_name (string): The ``VariantName`` of this production variant
1079+
(default: 'AllTraffic').
10771080
tags (List[dict[str, str]]): The list of tags to attach to this
10781081
specific endpoint.
10791082
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -1166,6 +1169,7 @@ def deploy(
11661169
self.name,
11671170
instance_type,
11681171
initial_instance_count,
1172+
variant_name=variant_name,
11691173
accelerator_type=accelerator_type,
11701174
serverless_inference_config=serverless_inference_config_dict,
11711175
volume_size=volume_size,

src/sagemaker/multidatamodel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def deploy(
158158
deserializer=None,
159159
accelerator_type=None,
160160
endpoint_name=None,
161+
variant_name="AllTraffic",
161162
tags=None,
162163
kms_key=None,
163164
wait=True,
@@ -203,6 +204,8 @@ def deploy(
203204
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
204205
endpoint_name (str): The name of the endpoint to create (default:
205206
None). If not specified, a unique endpoint name will be created.
207+
variant_name (string): The ``VariantName`` of this production variant
208+
(default: 'AllTraffic').
206209
tags (List[dict[str, str]]): The list of tags to attach to this
207210
specific endpoint.
208211
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -250,7 +253,11 @@ def deploy(
250253
)
251254

252255
production_variant = sagemaker.production_variant(
253-
self.name, instance_type, initial_instance_count, accelerator_type=accelerator_type
256+
self.name,
257+
instance_type,
258+
initial_instance_count,
259+
variant_name=variant_name,
260+
accelerator_type=accelerator_type,
254261
)
255262
if endpoint_name:
256263
self.endpoint_name = endpoint_name

0 commit comments

Comments
 (0)