Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion model-archiver/model_archiver/model_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import logging
import sys
import shutil
from .arg_parser import ArgParser
from .model_packaging_utils import ModelExportUtils
from .model_archiver_error import ModelArchiverError
Expand Down Expand Up @@ -36,7 +37,7 @@ def package_model(args, manifest):

# Step 2 : Zip 'em all up
ModelExportUtils.archive(export_file_path, model_name, model_path, manifest, args.archive_format)

shutil.rmtree(model_path)
logging.info("Successfully exported model %s to file %s", model_name, export_file_path)
except ModelArchiverError as e:
logging.error(e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
from collections import namedtuple

import pytest
import sys
from mock import MagicMock

sys.modules['shutil'] = MagicMock()
sys.modules['shutil.rmtree'] = MagicMock()

from model_archiver.manifest_components.manifest import RuntimeType
from model_archiver.model_packaging import generate_model_archive, package_model
Expand Down