@@ -1235,9 +1235,6 @@ def _validate_deploy_args(
12351235 traffic_percentage : Optional [int ],
12361236 deployment_resource_pool : Optional [DeploymentResourcePool ],
12371237 required_replica_count : Optional [int ],
1238- initial_replica_count : Optional [int ] = None ,
1239- min_scaleup_period : Optional [int ] = None ,
1240- idle_scaledown_period : Optional [int ] = None ,
12411238 ):
12421239 """Helper method to validate deploy arguments.
12431240
@@ -1293,17 +1290,6 @@ def _validate_deploy_args(
12931290 set, the model deploy/mutate operation will succeed once
12941291 available_replica_count reaches required_replica_count, and the
12951292 rest of the replicas will be retried.
1296- initial_replica_count (int):
1297- Optional. The number of replicas to deploy the model with.
1298- Only applicable for scale-to-zero deployments where
1299- min_replica_count is 0.
1300- min_scaleup_period (int):
1301- Optional. For scale-to-zero deployments, Minimum duration that
1302- a deployment will be scaled up before traffic is
1303- evaluated for potential scale-down.
1304- idle_scaledown_period (int):
1305- Optional. For scale-to-zero deployments, duration of no traffic
1306- before scaling to zero.
13071293
13081294 Raises:
13091295 ValueError: if Min or Max replica is negative. Traffic percentage > 100 or
@@ -1319,7 +1305,6 @@ def _validate_deploy_args(
13191305 and max_replica_count != 1
13201306 or required_replica_count
13211307 and required_replica_count != 0
1322- or initial_replica_count
13231308 ):
13241309 raise ValueError (
13251310 "Ignoring explicitly specified replica counts, "
@@ -1342,44 +1327,6 @@ def _validate_deploy_args(
13421327 raise ValueError ("Required replica cannot be negative." )
13431328 if accelerator_type :
13441329 utils .validate_accelerator_type (accelerator_type )
1345- if min_replica_count != 0 :
1346- if initial_replica_count :
1347- raise ValueError (
1348- "Initial replica count cannot be set for non-STZ models."
1349- )
1350- if min_scaleup_period :
1351- raise ValueError (
1352- "Min scaleup period cannot be set for non-STZ models."
1353- )
1354- if idle_scaledown_period :
1355- raise ValueError (
1356- "Idle scaledown period cannot be set for non-STZ models."
1357- )
1358- if min_replica_count == 0 and initial_replica_count :
1359- if initial_replica_count < 0 :
1360- raise ValueError ("Initial replica count must be at least 0." )
1361- if initial_replica_count > max_replica_count :
1362- raise ValueError (
1363- "Initial replica count cannot be greater than max replica count."
1364- )
1365- if min_replica_count == 0 and min_scaleup_period :
1366- if min_scaleup_period < 300 :
1367- raise ValueError (
1368- "Min scaleup period cannot be less than 300 (5 minutes)."
1369- )
1370- if min_scaleup_period > 28800 :
1371- raise ValueError (
1372- "Min scaleup period cannot be greater than 28800 (8 hours)."
1373- )
1374- if min_replica_count == 0 and idle_scaledown_period :
1375- if idle_scaledown_period < 300 :
1376- raise ValueError (
1377- "Idle scaledown period cannot be less than 300 (5 minutes)."
1378- )
1379- if idle_scaledown_period > 28800 :
1380- raise ValueError (
1381- "Idle scaledown period cannot be greater than 28800 (8 hours)."
1382- )
13831330
13841331 if deployed_model_display_name is not None :
13851332 utils .validate_display_name (deployed_model_display_name )
0 commit comments