Skip to content

Commit 2e81f95

Browse files
Serhiy-Shekhovtsovlaurenyu
authored andcommitted
fix: fix PyTorchModel deployment crash on Windows (#1212)
Starting from version `1.2` deployment of PyTorchModel always initiates repacking when uploading the code. It is done by calling `_upload_code` with `repack=True` parameter. On Windows, this will lead to a crash, because `os.path.join` method used to generate `repacked_model_uri` will use backslashes instead of slashes. So `utils.repack_model` will fail to parse it.
1 parent 3fc162e commit 2e81f95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sagemaker/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ def _upload_code(self, key_prefix, repack=False):
817817

818818
if repack:
819819
bucket = self.bucket or self.sagemaker_session.default_bucket()
820-
repacked_model_data = "s3://" + os.path.join(bucket, key_prefix, "model.tar.gz")
820+
repacked_model_data = "s3://" + "/".join([bucket, key_prefix, "model.tar.gz"])
821821

822822
utils.repack_model(
823823
inference_script=self.entry_point,

0 commit comments

Comments
 (0)