Skip to content

Commit 28d7f3b

Browse files
mxnet-sdk-team-mmsvdantu
authored andcommitted
Updated doc string
1 parent 4774f13 commit 28d7f3b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/sagemaker_huggingface_inference_toolkit/handler_service.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def predict(self, data, model):
133133
The predict handler can be overridden to implement the model inference.
134134
Args:
135135
data (dict): deserialized decoded_input_data returned by the input_fn
136+
model : Model returned by "model_fn".
136137
Returns:
137138
obj (dict): prediction result.
138139
"""
@@ -161,6 +162,18 @@ def postprocess(self, prediction, accept):
161162
return decoder_encoder.encode(prediction, accept)
162163

163164
def transform_fn(self, model, input_data, content_type, accept):
165+
"""
166+
Transform function ("transform_fn") can be used to write one function with pre/post-processing steps and predict step in it.
167+
This fuction can't be mixed with "input_fn", "output_fn" or "predict_fn"
168+
Args:
169+
model: Model returned by the model_fn above
170+
input_data: Data received for inference
171+
content_type: The content type of the inference data
172+
accept: The response accept type.
173+
174+
Returns: Response in the "accept" format type.
175+
176+
"""
164177
# run pipeline
165178
start_time = time.time()
166179
processed_data = self.preprocess(input_data, content_type)

0 commit comments

Comments
 (0)