File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed
src/sagemaker/inference_recommender
tests/unit/sagemaker/model Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -398,19 +398,17 @@ def _update_params_for_recommendation_id(
398
398
# Update params beased on model recommendation
399
399
if model_recommendation :
400
400
if initial_instance_count is None :
401
- raise ValueError (
402
- "Please specify initial_instance_count with model recommendation id"
403
- )
401
+ raise ValueError ("Must specify model recommendation id and instance count." )
404
402
self .env .update (model_recommendation ["Environment" ])
405
403
instance_type = model_recommendation ["InstanceType" ]
406
404
return (instance_type , initial_instance_count )
407
405
408
406
# Update params based on default inference recommendation
409
407
if bool (instance_type ) != bool (initial_instance_count ):
410
408
raise ValueError (
411
- "Please either do not specify instance_type and initial_instance_count "
412
- "since they are in recommendation, or specify both of them if you want "
413
- "to override the recommendation."
409
+ "instance_type and initial_instance_count are mutually exclusive with "
410
+ "recommendation id since they are in recommendation. "
411
+ "Please specify both of them if you want to override the recommendation."
414
412
)
415
413
input_config = right_size_job_res ["InputConfig" ]
416
414
model_config = right_size_recommendation ["ModelConfiguration" ]
Original file line number Diff line number Diff line change @@ -555,9 +555,9 @@ def test_deploy_ir_with_incompatible_parameters(sagemaker_session):
555
555
556
556
with pytest .raises (
557
557
ValueError ,
558
- match = "Please either do not specify instance_type and initial_instance_count "
559
- "since they are in recommendation, or specify both of them if you want "
560
- "to override the recommendation." ,
558
+ match = "instance_type and initial_instance_count are mutually exclusive with "
559
+ "recommendation id since they are in recommendation. "
560
+ "Please specify both of them if you want to override the recommendation." ,
561
561
):
562
562
model .deploy (
563
563
instance_type = INSTANCE_TYPE ,
@@ -566,9 +566,9 @@ def test_deploy_ir_with_incompatible_parameters(sagemaker_session):
566
566
567
567
with pytest .raises (
568
568
ValueError ,
569
- match = "Please either do not specify instance_type and initial_instance_count "
570
- "since they are in recommendation, or specify both of them if you want "
571
- "to override the recommendation." ,
569
+ match = "instance_type and initial_instance_count are mutually exclusive with "
570
+ "recommendation id since they are in recommendation. "
571
+ "Please specify both of them if you want to override the recommendation." ,
572
572
):
573
573
model .deploy (
574
574
initial_instance_count = INSTANCE_COUNT ,
You can’t perform that action at this time.
0 commit comments