@@ -315,39 +315,21 @@ def test_gated_model_s3_uri(
315315 mock_session_estimator .return_value = sagemaker_session
316316 mock_session_model .return_value = sagemaker_session
317317
318- JumpStartEstimator (
319- model_id = model_id ,
320- environment = {
321- "accept_eula" : "false" ,
322- "what am i" : "doing" ,
323- "SageMakerGatedModelS3Uri" : "none of your business" ,
324- },
325- )
326-
327- mock_estimator_init .assert_called_once_with (
328- instance_type = "ml.p3.2xlarge" ,
329- instance_count = 1 ,
330- image_uri = "763104351884.dkr.ecr.us-west-2.amazonaws.com/djl-inference:0.21.0-deepspeed0.8.3-cu117" ,
331- source_dir = "s3://jumpstart-cache-prod-us-west-2/source-directory-tarballs/"
332- "meta/transfer_learning/textgeneration/v1.0.0/sourcedir.tar.gz" ,
333- entry_point = "transfer_learning.py" ,
334- role = execution_role ,
335- sagemaker_session = sagemaker_session ,
336- max_run = 360000 ,
337- enable_network_isolation = True ,
338- encrypt_inter_container_traffic = True ,
339- environment = {
340- "accept_eula" : "false" ,
341- "what am i" : "doing" ,
342- "SageMakerGatedModelS3Uri" : "none of your business" ,
343- },
344- tags = [
345- {
346- "Key" : "sagemaker-sdk:jumpstart-model-id" ,
347- "Value" : "js-gated-artifact-trainable-model" ,
318+ with pytest .raises (ValueError ) as e :
319+ JumpStartEstimator (
320+ model_id = model_id ,
321+ environment = {
322+ "accept_eula" : "false" ,
323+ "what am i" : "doing" ,
324+ "SageMakerGatedModelS3Uri" : "none of your business" ,
348325 },
349- {"Key" : "sagemaker-sdk:jumpstart-model-version" , "Value" : "2.0.0" },
350- ],
326+ )
327+ assert str (e .value ) == (
328+ "Need to define ‘accept_eula'='true' within Environment. "
329+ "Model 'meta-textgeneration-llama-2-7b-f' requires accepting end-user "
330+ "license agreement (EULA). See "
331+ "https://jumpstart-cache-prod-us-west-2.s3.us-west-2.amazonaws.com/fmhMetadata/eula/llamaEula.txt"
332+ " for terms of use."
351333 )
352334
353335 mock_estimator_init .reset_mock ()
0 commit comments