Skip to content

Commit 3f9b30d

Browse files
committed
Update model path in local mode
1 parent 57fd632 commit 3f9b30d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/sagemaker/local/image.py

+1
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ def retrieve_artifacts(self, compose_data, output_data_config, job_name):
430430
output_data_config["S3OutputPath"],
431431
job_name,
432432
self.sagemaker_session,
433+
prefix="output",
433434
)
434435

435436
_delete_tree(model_artifacts)

src/sagemaker/local/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def copy_directory_structure(destination_directory, relative_path):
5353
os.makedirs(destination_directory, relative_path)
5454

5555

56-
def move_to_destination(source, destination, job_name, sagemaker_session):
56+
def move_to_destination(source, destination, job_name, sagemaker_session, prefix=""):
5757
"""Move source to destination.
5858
5959
Can handle uploading to S3.
@@ -64,6 +64,8 @@ def move_to_destination(source, destination, job_name, sagemaker_session):
6464
job_name (str): SageMaker job name.
6565
sagemaker_session (sagemaker.Session): a sagemaker_session to interact
6666
with S3 if needed
67+
prefix (str, optional): the directory on S3 used to save files, default
68+
to the root of ``destination``
6769
6870
Returns:
6971
(str): destination URI
@@ -75,7 +77,7 @@ def move_to_destination(source, destination, job_name, sagemaker_session):
7577
final_uri = destination
7678
elif parsed_uri.scheme == "s3":
7779
bucket = parsed_uri.netloc
78-
path = s3.s3_path_join(parsed_uri.path, job_name)
80+
path = s3.s3_path_join(parsed_uri.path, job_name, prefix)
7981
final_uri = s3.s3_path_join("s3://", bucket, path)
8082
sagemaker_session.upload_data(source, bucket, path)
8183
else:

0 commit comments

Comments
 (0)