Skip to content

Commit 7a13971

Browse files
committed
fix(model_builder): Only set s3_upload_path for S3 URIs in passthrough
In _build_for_passthrough(), model_path could be a local /tmp path. Setting s3_upload_path to a local path caused CreateModel API to reject the modelDataUrl with a validation error since it requires s3:// or https:// URIs. Now only S3 URIs are assigned to s3_upload_path; local paths are handled separately by _prepare_for_mode() in LOCAL_CONTAINER mode.
1 parent d7c98bb commit 7a13971

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sagemaker-serve/src/sagemaker/serve/model_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,10 +1289,10 @@ def _build_for_passthrough(self) -> Model:
12891289

12901290
self.secret_key = ""
12911291

1292-
if not self.model_path:
1293-
self.s3_upload_path = None
1294-
else:
1292+
if self.model_path and self.model_path.startswith("s3://"):
12951293
self.s3_upload_path = self.model_path
1294+
else:
1295+
self.s3_upload_path = None
12961296

12971297
if self.mode in LOCAL_MODES:
12981298
self._prepare_for_mode()

0 commit comments

Comments
 (0)