Skip to content

Commit 5a3b31d

Browse files
committed
Add variant_name kwarg
1 parent 858e943 commit 5a3b31d

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
@@ -186,6 +186,7 @@ def deploy(
186186
deserializer=None,
187187
accelerator_type=None,
188188
endpoint_name=None,
189+
variant_name="AllTraffic",
189190
tags=None,
190191
kms_key=None,
191192
wait=True,
@@ -234,6 +235,8 @@ def deploy(
234235
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
235236
endpoint_name (str): The name of the endpoint to create (default:
236237
None). If not specified, a unique endpoint name will be created.
238+
variant_name (string): The ``VariantName`` of this production variant
239+
(default: 'AllTraffic').
237240
tags (List[dict[str, str]]): The list of tags to attach to this
238241
specific endpoint.
239242
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -281,6 +284,7 @@ def deploy(
281284
deserializer,
282285
accelerator_type,
283286
endpoint_name,
287+
variant_name,
284288
tags,
285289
kms_key,
286290
wait,

src/sagemaker/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ def deploy(
956956
deserializer=None,
957957
accelerator_type=None,
958958
endpoint_name=None,
959+
variant_name="AllTraffic",
959960
tags=None,
960961
kms_key=None,
961962
wait=True,
@@ -1004,6 +1005,8 @@ def deploy(
10041005
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
10051006
endpoint_name (str): The name of the endpoint to create (default:
10061007
None). If not specified, a unique endpoint name will be created.
1008+
variant_name (string): The ``VariantName`` of this production variant
1009+
(default: 'AllTraffic').
10071010
tags (List[dict[str, str]]): The list of tags to attach to this
10081011
specific endpoint.
10091012
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -1086,6 +1089,7 @@ def deploy(
10861089
self.name,
10871090
instance_type,
10881091
initial_instance_count,
1092+
variant_name=variant_name,
10891093
accelerator_type=accelerator_type,
10901094
serverless_inference_config=serverless_inference_config_dict,
10911095
)

src/sagemaker/multidatamodel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def deploy(
152152
deserializer=None,
153153
accelerator_type=None,
154154
endpoint_name=None,
155+
variant_name="AllTraffic",
155156
tags=None,
156157
kms_key=None,
157158
wait=True,
@@ -197,6 +198,8 @@ def deploy(
197198
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
198199
endpoint_name (str): The name of the endpoint to create (default:
199200
None). If not specified, a unique endpoint name will be created.
201+
variant_name (string): The ``VariantName`` of this production variant
202+
(default: 'AllTraffic').
200203
tags (List[dict[str, str]]): The list of tags to attach to this
201204
specific endpoint.
202205
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -244,7 +247,11 @@ def deploy(
244247
)
245248

246249
production_variant = sagemaker.production_variant(
247-
self.name, instance_type, initial_instance_count, accelerator_type=accelerator_type
250+
self.name,
251+
instance_type,
252+
initial_instance_count,
253+
variant_name=variant_name,
254+
accelerator_type=accelerator_type,
248255
)
249256
if endpoint_name:
250257
self.endpoint_name = endpoint_name

0 commit comments

Comments
 (0)