entry_point.pyͷྫ import numpy as np def input_fn(serialized_input, content_type): """An input_fn that loads a pickled object""" if request_content_type == "application/python-pickle": deserialized_input = pickle.loads(serialized_input) return deserialized_input else: # Handle other content-types here or raise an Exception # if the content type is not supported. pass def output_fn(prediction_result, accepts): """An output_fn that dumps a pickled object as response""" if request_content_type == "application/python-pickle": return np.dumps(prediction_result) else: # Handle other content-types here or raise an Exception # if the content type is not supported. pass