def METHOD_NAME(data):
    try:
        # Pick out the text property of the JSON request.
        # This expects a request in the form of {"text": "some text to score for sentiment"}
        start_at = time.time()
        inputs = json.loads(data)
        img_data_list = inputs["instances"]
        inputs = torch.tensor(img_data_list).to(device)
        with torch.no_grad():
            predictions = model(inputs)
        return {"predicts": predictions.numpy().tolist(),
                "elapsed_time": time.time() - start_at}
    except Exception as e:
        error = str(e)
        print(error)
        raise e