Skip to content

Commit 1463743

Browse files
authored
fix: don't use os.path.join for S3 path when repacking TFS model (aws#1302)
S3 paths always use forward slashes ("/") regardless of the OS, so using an os.path.join will cause issues when the user is on Windows.
1 parent e5aa5a7 commit 1463743

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/sagemaker/tensorflow/serving.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from __future__ import absolute_import
1515

1616
import logging
17-
import os
1817

1918
import sagemaker
2019
from sagemaker.content_types import CONTENT_TYPE_JSON
@@ -229,7 +228,7 @@ def prepare_container_def(self, instance_type, accelerator_type=None):
229228
key_prefix = sagemaker.fw_utils.model_code_key_prefix(self.key_prefix, self.name, image)
230229

231230
bucket = self.bucket or self.sagemaker_session.default_bucket()
232-
model_data = "s3://" + os.path.join(bucket, key_prefix, "model.tar.gz")
231+
model_data = "s3://{}/{}/model.tar.gz".format(bucket, key_prefix)
233232

234233
sagemaker.utils.repack_model(
235234
self.entry_point,

0 commit comments

Comments
 (0)