Skip to content

Commit 8fa41f3

Browse files
hardianlawiclaytonparnell
authored andcommitted
Add variant_name kwarg
1 parent f2d5e41 commit 8fa41f3

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,
@@ -248,6 +249,8 @@ def deploy(
248249
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
249250
endpoint_name (str): The name of the endpoint to create (default:
250251
None). If not specified, a unique endpoint name will be created.
252+
variant_name (string): The ``VariantName`` of this production variant
253+
(default: 'AllTraffic').
251254
tags (List[dict[str, str]]): The list of tags to attach to this
252255
specific endpoint.
253256
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -295,6 +298,7 @@ def deploy(
295298
deserializer,
296299
accelerator_type,
297300
endpoint_name,
301+
variant_name,
298302
tags,
299303
kms_key,
300304
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,
@@ -1071,6 +1072,8 @@ def deploy(
10711072
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html
10721073
endpoint_name (str): The name of the endpoint to create (default:
10731074
None). If not specified, a unique endpoint name will be created.
1075+
variant_name (string): The ``VariantName`` of this production variant
1076+
(default: 'AllTraffic').
10741077
tags (List[dict[str, str]]): The list of tags to attach to this
10751078
specific endpoint.
10761079
kms_key (str): The ARN of the KMS key that is used to encrypt the
@@ -1153,6 +1156,7 @@ def deploy(
11531156
self.name,
11541157
instance_type,
11551158
initial_instance_count,
1159+
variant_name=variant_name,
11561160
accelerator_type=accelerator_type,
11571161
serverless_inference_config=serverless_inference_config_dict,
11581162
)

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)