def METHOD_NAME(self, model_inputs):
    candidate_labels = model_inputs.pop("candidate_labels")
    text_inputs = model_inputs.pop("text_inputs")
    if isinstance(text_inputs[0], UserDict):
        text_inputs = text_inputs[0]
    else:
        # Batching case.
        text_inputs = text_inputs[0][0]
    outputs = self.model(**text_inputs, **model_inputs)
    model_outputs = {
        "candidate_labels": candidate_labels,
        "logits": outputs.logits_per_image,
    }
    return model_outputs