Skip to content

Commit f174fa4

Browse files
remove import
1 parent 209285d commit f174fa4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/sagemaker/workflow/_repack_model.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
# repacking is some short-lived hackery, right??
3434
from distutils.dir_util import copy_tree
3535

36-
from sagemaker.utils import check_tarfile_data_filter_attribute
37-
3836

3937
def repack(inference_script, model_archive, dependencies=None, source_dir=None): # pragma: no cover
4038
"""Repack custom dependencies and code into an existing model TAR archive
@@ -62,8 +60,7 @@ def repack(inference_script, model_archive, dependencies=None, source_dir=None):
6260
# extract the contents of the previous training job's model archive to the "src"
6361
# directory of this training job
6462
with tarfile.open(name=local_path, mode="r:gz") as tf:
65-
check_tarfile_data_filter_attribute()
66-
tf.extractall(path=src_dir, filter="data")
63+
tf.extractall(path=src_dir)
6764

6865
if source_dir:
6966
# copy /opt/ml/code to code/

src/sagemaker/workflow/_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
_save_model,
3737
download_file_from_url,
3838
format_tags,
39+
check_tarfile_data_filter_attribute,
3940
)
4041
from sagemaker.workflow.retry import RetryPolicy
4142
from sagemaker.workflow.utilities import trim_request_dict
@@ -261,7 +262,8 @@ def _inject_repack_script_and_launcher(self):
261262
download_file_from_url(self._source_dir, old_targz_path, self.sagemaker_session)
262263

263264
with tarfile.open(name=old_targz_path, mode="r:gz") as t:
264-
t.extractall(path=targz_contents_dir)
265+
check_tarfile_data_filter_attribute()
266+
t.extractall(path=targz_contents_dir, filter="data")
265267

266268
shutil.copy2(fname, os.path.join(targz_contents_dir, REPACK_SCRIPT))
267269
with open(

0 commit comments

Comments
 (0)