src/transformers/generation/logits_process.py/EncoderRepetitionPenaltyLogitsProcessor/__init__
class EncoderRepetitionPenaltyLogitsProcessor:    def __init__(self, penalty: float, encoder_input_ids: torch.LongTensor):
        if not isinstance(penalty, float) or not (penalty > 0):
            raise ValueError(f"`penalty` has to be a strictly positive float, but is {penalty}")

        self.penalty = 1 / penalty
        self.encoder_input_ids = encoder_input_ids