Skip to content

Commit 3e3cd33

Browse files
authored
ensure model store path exists
1 parent 6662829 commit 3e3cd33

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sagemaker_pytorch_serving_container/torchserve.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,12 @@ def start_torchserve(handler_service=DEFAULT_HANDLER_SERVICE):
6868
6969
"""
7070

71-
if ENABLE_MULTI_MODEL and "SAGEMAKER_HANDLER" not in os.environ:
72-
os.environ["SAGEMAKER_HANDLER"] = handler_service
71+
if ENABLE_MULTI_MODEL:
72+
if "SAGEMAKER_HANDLER" not in os.environ:
73+
os.environ["SAGEMAKER_HANDLER"] = handler_service
74+
else:
75+
if not os.path.exists(MODEL_STORE):
76+
os.makedirs(MODEL_STORE)
7377

7478
_set_python_path()
7579

0 commit comments

Comments
 (0)