diff --git a/src/transformers/generation_logits_process.py b/src/transformers/generation_logits_process.py index a027eacbde4..ac77b6b224a 100644 --- a/src/transformers/generation_logits_process.py +++ b/src/transformers/generation_logits_process.py @@ -439,8 +439,6 @@ class HammingDiversityLogitsProcessor(LogitsProcessor): raise ValueError("`num_beam_groups` should be an integer strictly larger than 1.") if num_beam_groups > num_beams: raise ValueError("`beam_groups` has to be smaller or equal to `num_beams`.") - if num_beam_groups > num_beams: - raise ValueError("`beam_groups` has to be smaller or equal to `num_beams`") self._num_sub_beams = num_beams // num_beam_groups def __call__(