def default_output_fn()

in src/sagemaker_inference/default_inference_handler.py [0:0]


    def default_output_fn(self, prediction, accept):  # pylint: disable=no-self-use
        """Function responsible for serializing the prediction result to the desired accept type.

        Args:
            prediction (obj): prediction result returned by the predict_fn.
            accept (str): accept header expected by the client.

        Returns:
            obj: prediction data.

        """
        for content_type in utils.parse_accept(accept):
            if content_type in encoder.SUPPORTED_CONTENT_TYPES:
                return encoder.encode(prediction, content_type), content_type
        raise errors.UnsupportedFormatError(accept)