36
36
)
37
37
from tests .integ .sagemaker .jumpstart .utils import (
38
38
get_sm_session ,
39
- get_training_dataset_for_model_and_version
39
+ get_training_dataset_for_model_and_version ,
40
40
)
41
41
42
42
from sagemaker .jumpstart .utils import get_jumpstart_content_bucket
@@ -81,13 +81,13 @@ def test_jumpstart_hub_estimator(setup, add_model_references):
81
81
)
82
82
83
83
estimator .fit (
84
- inputs = {
84
+ inputs = {
85
85
"training" : f"s3://{ get_jumpstart_content_bucket (JUMPSTART_DEFAULT_REGION_NAME )} /"
86
86
f"{ get_training_dataset_for_model_and_version (model_id , model_version )} " ,
87
87
}
88
88
)
89
89
90
- # test that we can create a JumpStartEstimator from existing job with `attach`
90
+ # test that we can create a JumpStartEstimator from existing job with `attach`
91
91
estimator = JumpStartEstimator .attach (
92
92
training_job_name = estimator .latest_training_job .name ,
93
93
model_id = model_id ,
@@ -121,14 +121,13 @@ def test_jumpstart_hub_estimator_with_default_session(setup, add_model_reference
121
121
)
122
122
123
123
estimator .fit (
124
- inputs = {
124
+ inputs = {
125
125
"training" : f"s3://{ get_jumpstart_content_bucket (JUMPSTART_DEFAULT_REGION_NAME )} /"
126
126
f"{ get_training_dataset_for_model_and_version (model_id , model_version )} " ,
127
127
}
128
128
)
129
129
130
-
131
- # test that we can create a JumpStartEstimator from existing job with `attach`
130
+ # test that we can create a JumpStartEstimator from existing job with `attach`
132
131
estimator = JumpStartEstimator .attach (
133
132
training_job_name = estimator .latest_training_job .name ,
134
133
model_id = model_id ,
@@ -138,7 +137,7 @@ def test_jumpstart_hub_estimator_with_default_session(setup, add_model_reference
138
137
# uses ml.p3.2xlarge instance
139
138
predictor = estimator .deploy (
140
139
tags = [{"Key" : JUMPSTART_TAG , "Value" : os .environ [ENV_VAR_JUMPSTART_SDK_TEST_SUITE_ID ]}],
141
- role = get_sm_session ().get_caller_identity_arn ()
140
+ role = get_sm_session ().get_caller_identity_arn (),
142
141
)
143
142
144
143
response = predictor .predict (["hello" , "world" ])
@@ -159,10 +158,10 @@ def test_jumpstart_hub_gated_estimator_with_eula(setup, add_model_references):
159
158
160
159
estimator .fit (
161
160
accept_eula = True ,
162
- inputs = {
161
+ inputs = {
163
162
"training" : f"s3://{ get_jumpstart_content_bucket (JUMPSTART_DEFAULT_REGION_NAME )} /"
164
163
f"{ get_training_dataset_for_model_and_version (model_id , model_version )} " ,
165
- }
164
+ },
166
165
)
167
166
168
167
estimator = JumpStartEstimator .attach (
@@ -196,14 +195,13 @@ def test_jumpstart_hub_gated_estimator_without_eula(setup, add_model_references)
196
195
)
197
196
with pytest .raises (Exception ):
198
197
estimator .fit (
199
- inputs = {
198
+ inputs = {
200
199
"training" : f"s3://{ get_jumpstart_content_bucket (JUMPSTART_DEFAULT_REGION_NAME )} /"
201
200
f"{ get_training_dataset_for_model_and_version (model_id , model_version )} " ,
202
201
}
203
202
)
204
203
205
204
206
-
207
205
def test_instantiating_estimator (setup , add_model_references ):
208
206
209
207
model_id = "catboost-regression-model"
0 commit comments