Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing the temp directory with model files after packaging #1016

Merged
merged 6 commits into from
Jul 29, 2021
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)
maaquib marked this conversation as resolved.
Show resolved Hide resolved
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