Skip to content

Commit 69eeea9

Browse files
committed
Fix: Don't load default model in MME mode
1 parent 0513c7a commit 69eeea9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sagemaker_pytorch_serving_container/torchserve.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ def start_torchserve(handler_service=DEFAULT_HANDLER_SERVICE):
9090
TS_CONFIG_FILE,
9191
"--log-config",
9292
DEFAULT_TS_LOG_FILE,
93-
"--models",
94-
DEFAULT_TS_MODEL_NAME + "=" + environment.model_dir
9593
]
9694

95+
default_model_path_args = ["--models", DEFAULT_TS_MODEL_NAME + "=" + environment.model_dir]
96+
97+
if not ENABLE_MULTI_MODEL:
98+
ts_torchserve_cmd += default_model_path_args
99+
97100
print(ts_torchserve_cmd)
98101

99102
logger.info(ts_torchserve_cmd)
@@ -138,7 +141,7 @@ def _generate_ts_config_properties(handler_service):
138141
if ts_env.is_env_set() and not ENABLE_MULTI_MODEL:
139142
models_string = f'''{{\\
140143
"{DEFAULT_TS_MODEL_NAME}": {{\\
141-
"1.0": {{\\
144+
"1": {{\\
142145
"defaultVersion": true,\\
143146
"marName": "{DEFAULT_TS_MODEL_NAME}.mar",\\
144147
"minWorkers": {ts_env._min_workers},\\

0 commit comments

Comments
 (0)