def _forward(self, model_inputs):
    return self.model(**model_inputs)

def postprocess(self, model_outputs):
    logits = model_outputs.logits[0].numpy()
    probabilities = softmax(logits)

    best_class = np.argmax(probabilities)
    label = self.model.config.id2label[best_class]
    score = probabilities[best_class].item()
    logits = logits.tolist()
    return {"label": label, "score": score, "logits": logits}