@@ -1632,16 +1632,16 @@ def get_draft_model_content_bucket(provider: Dict, region: str) -> str:
1632
1632
return neo_bucket
1633
1633
1634
1634
1635
- def remove_env_var_from_estimator_kwargs_if_accept_eula_present (
1636
- init_kwargs : dict , accept_eula : Optional [ bool ]
1635
+ def remove_env_var_from_estimator_kwargs_if_model_access_config_present (
1636
+ init_kwargs : dict , model_access_config : dict | None
1637
1637
):
1638
- """Remove env vars if access configs are used
1638
+ """Remove env vars if ModelAccessConfig is used
1639
1639
1640
1640
Args:
1641
1641
init_kwargs (dict): Dictionary of kwargs when Estimator is instantiated.
1642
1642
accept_eula (Optional[bool]): Whether or not the EULA was accepted, optionally passed in to Estimator.fit().
1643
1643
"""
1644
- if accept_eula is not None and init_kwargs .get ("environment" ) is not None :
1644
+ if model_access_config is not None and init_kwargs .get ("environment" ) is not None :
1645
1645
if (
1646
1646
constants .SAGEMAKER_GATED_MODEL_S3_URI_TRAINING_ENV_VAR_KEY
1647
1647
in init_kwargs ["environment" ]
@@ -1672,7 +1672,7 @@ def get_model_access_config(accept_eula: Optional[bool], environment: Optional[d
1672
1672
accept_eula (Optional[bool]): Whether or not the EULA was accepted, optionally passed in to Estimator.fit().
1673
1673
"""
1674
1674
env_var_eula = environment .get ("accept_eula" ) if environment else None
1675
- if env_var_eula and accept_eula is not None :
1675
+ if env_var_eula is not None and accept_eula is not None :
1676
1676
raise ValueError (
1677
1677
"Cannot pass in both accept_eula and environment variables. "
1678
1678
"Please remove the environment variable and pass in the accept_eula parameter."
0 commit comments