diff --git a/model-archiver/model_archiver/model_packaging_utils.py b/model-archiver/model_archiver/model_packaging_utils.py index 6243fc5ef6..f75794e5c9 100644 --- a/model-archiver/model_archiver/model_packaging_utils.py +++ b/model-archiver/model_archiver/model_packaging_utils.py @@ -10,6 +10,7 @@ import sys import tarfile import tempfile +import uuid import zipfile from io import BytesIO from pathlib import Path @@ -153,7 +154,7 @@ def copy_artifacts(model_name, runtime, **kwargs): :param kwargs: key value pair of files to be copied in archive :return: """ - model_path = os.path.join(tempfile.gettempdir(), model_name) + model_path = os.path.join(tempfile.gettempdir(), model_name, uuid.uuid4().hex) if os.path.exists(model_path): shutil.rmtree(model_path) ModelExportUtils.make_dir(model_path)