def METHOD_NAME(self,
                inputs: Union[Dict[str, Any],
                              TextClassificationModelOutput],
                topk: int = None) -> Dict[str, Any]:
    """Process the prediction results
    Args:
        inputs (`Dict[str, Any]` or `TextClassificationModelOutput`): The model output, please check
            the `TextClassificationModelOutput` class for details.
        topk (int): The topk probs to take
    Returns:
        Dict[str, Any]: the prediction results.
            scores: The probabilities of each label.
            labels: The real labels.
        Label at index 0 is the smallest probability.
    """
    if self.model.__class__.__name__ == 'OfaForAllTasks':
        return inputs
    else:
        if getattr(self, 'id2label', None) is None:
            logger.warning(
                'The id2label mapping is None, will return original ids.')
        logits = inputs[OutputKeys.LOGITS].cpu().numpy()
        if logits.shape[0] == 1:
            logits = logits[0]
        def softmax(logits):
            exp = np.exp(logits - np.max(logits, axis=-1, keepdims=True))
            return exp / exp.sum(axis=-1, keepdims=True)
        probs = softmax(logits)
        num_classes = probs.shape[-1]
        topk = min(topk, num_classes) if topk is not None else num_classes
        top_indices = np.argpartition(probs, -topk)[-topk:]
        probs = np.take_along_axis(probs, top_indices, axis=-1).tolist()
        def map_to_label(id):
            if getattr(self, 'id2label', None) is not None:
                if id in self.id2label:
                    return self.id2label[id]
                elif str(id) in self.id2label:
                    return self.id2label[str(id)]
                else:
                    raise Exception(
                        f'id {id} not found in id2label: {self.id2label}')
            else:
                return id
        v_func = np.vectorize(map_to_label)
        top_indices = v_func(top_indices).tolist()
        probs = list(reversed(probs))
        top_indices = list(reversed(top_indices))
        return {OutputKeys.SCORES: probs, OutputKeys.LABELS: top_indices}