File tree 3 files changed +16
-5
lines changed
3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -2319,9 +2319,13 @@ def _model_source_dir(self):
2319
2319
str: Either a local or an S3 path pointing to the ``source_dir`` to be
2320
2320
used for code by the model to be deployed
2321
2321
"""
2322
- return (
2323
- self .source_dir if self .sagemaker_session .local_mode else self .uploaded_code .s3_prefix
2324
- )
2322
+ if self .sagemaker_session .local_mode :
2323
+ return self .source_dir
2324
+
2325
+ if self .uploaded_code is not None :
2326
+ return self .uploaded_code .s3_prefix
2327
+
2328
+ return None
2325
2329
2326
2330
def _model_entry_point (self ):
2327
2331
"""Get the appropriate value to pass as ``entry_point`` to a model constructor.
@@ -2333,7 +2337,10 @@ def _model_entry_point(self):
2333
2337
if self .sagemaker_session .local_mode or (self ._model_source_dir () is None ):
2334
2338
return self .entry_point
2335
2339
2336
- return self .uploaded_code .script_name
2340
+ if self .uploaded_code is not None :
2341
+ return self .uploaded_code .script_name
2342
+
2343
+ return None
2337
2344
2338
2345
def hyperparameters (self ):
2339
2346
"""Return the hyperparameters as a dictionary to use for training.
Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ def arguments(self) -> RequestType:
312
312
model = self .estimator .create_model (** self .kwargs )
313
313
self .image_uri = model .image_uri
314
314
315
+ if self .model_data is None :
316
+ self .model_data = model .model_data
317
+
315
318
# reset placeholder
316
319
self .estimator .output_path = output_path
317
320
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ def __init__(
146
146
else :
147
147
sagemaker_session = model_entity .sagemaker_session
148
148
role = model_entity .role
149
- if hasattr (model_entity , "entry_point" ):
149
+ if hasattr (model_entity , "entry_point" ) and model_entity . entry_point is not None :
150
150
repack_model = True
151
151
entry_point = model_entity .entry_point
152
152
source_dir = model_entity .source_dir
@@ -169,6 +169,7 @@ def __init__(
169
169
model_entity .model_data = (
170
170
repack_model_step .properties .ModelArtifacts .S3ModelArtifacts
171
171
)
172
+
172
173
# remove kwargs consumed by model repacking step
173
174
kwargs .pop ("output_kms_key" , None )
174
175
You can’t perform that action at this time.
0 commit comments