Skip to content

Commit cfaf318

Browse files
author
EC2 Default User
committed
fast follow on js uncompressed support
1 parent b7337fe commit cfaf318

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sagemaker/serve/model_server/tgi/prepare.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ def _copy_jumpstart_artifacts(model_data: str, js_id: str, code_dir: Path) -> bo
1717
"""Placeholder Docstring"""
1818
logger.info("Downloading JumpStart artifacts from S3...")
1919
with _tmpdir(directory=str(code_dir)) as js_model_dir:
20-
# TODO: remove if block after 10/30 once everything is shifted to uncompressed
21-
if model_data.endswith("tar.gz"):
22-
subprocess.run(["aws", "s3", "cp", model_data, js_model_dir])
23-
20+
js_model_data_loc = model_data.get("S3DataSource").get("S3Uri")
21+
# TODO: leave this check here until we are sure every js model has moved to uncompressed
22+
if js_model_data_loc.endswith("tar.gz"):
23+
subprocess.run(["aws", "s3", "cp", js_model_data_loc, js_model_dir])
2424
logger.info("Uncompressing JumpStart artifacts for faster loading...")
2525
tmp_sourcedir = Path(js_model_dir).joinpath(f"infer-prepack-{js_id}.tar.gz")
2626
with tarfile.open(str(tmp_sourcedir)) as resources:
2727
resources.extractall(path=code_dir)
2828
else:
29-
subprocess.run(["aws", "s3", "cp", model_data, js_model_dir, "--recursive"])
29+
subprocess.run(["aws", "s3", "cp", js_model_data_loc, js_model_dir, "--recursive"])
3030
return True
3131

3232

0 commit comments

Comments
 (0)