import json


def output_fn(prediction_output, accept='application/json'):
    """
    Converts the outputted json to bytes
    """
    if accept == 'application/json':
        # logger.info("Output successfully parsed.")
        return json.dumps(prediction_output).encode('utf-8')
    raise Exception('Requested unsupported ContentType in Accept: ' + accept)