Skip to content

Commit 54241b4

Browse files
author
Bryannah Hernandez
committed
Remove loggers and add docstring updates
1 parent c2cb579 commit 54241b4

File tree

1 file changed

+4
-7
lines changed
  • src/sagemaker/serve/model_server/multi_model_server

1 file changed

+4
-7
lines changed

src/sagemaker/serve/model_server/multi_model_server/inference.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
def model_fn(model_dir):
25-
"""Placeholder docstring"""
25+
"""Overrides default method for loading a model"""
2626
shared_libs_path = Path(model_dir + "/shared_libs")
2727

2828
if shared_libs_path.exists():
@@ -36,14 +36,12 @@ def model_fn(model_dir):
3636
if isinstance(obj[0], InferenceSpec):
3737
inference_spec, schema_builder = obj
3838

39-
logger.info("in model_fn")
40-
4139
if inference_spec:
4240
return partial(inference_spec.invoke, model=inference_spec.load(model_dir))
4341

4442

4543
def input_fn(input_data, content_type):
46-
"""Placeholder docstring"""
44+
"""Deserializes the bytes that were received from the model server"""
4745
try:
4846
if hasattr(schema_builder, "custom_input_translator"):
4947
return schema_builder.custom_input_translator.deserialize(
@@ -59,13 +57,12 @@ def input_fn(input_data, content_type):
5957

6058

6159
def predict_fn(input_data, predict_callable):
62-
"""Placeholder docstring"""
63-
logger.info("in predict_fn")
60+
"""Invokes the model that is taken in by model server"""
6461
return predict_callable(input_data)
6562

6663

6764
def output_fn(predictions, accept_type):
68-
"""Placeholder docstring"""
65+
"""Prediction is serialized to bytes and sent back to the customer"""
6966
try:
7067
if hasattr(schema_builder, "custom_output_translator"):
7168
return schema_builder.custom_output_translator.serialize(predictions, accept_type)

0 commit comments

Comments
 (0)