New mode in `model.generate`
Hello, is there any support for combining `contrastive_search` and `beam_search` in `model.generate` method?

My motivation is that when using `beam_search` I observe the outputs of model sometimes tend to produce repetitive text. I learned that `contrastive_search` was proposed to address the repetition issue. But when changing to `contrastive_mode`, the performance drops a lot, probably due to a lack of the beams. However, I checked the source code and found `contrastive_mode` triggers only when `num_beams == 1`.

Therefore, I wonder if I can combine the advantages of the two generation modes for better result?
cc @gante <|||||>Hey @huangjy-pku I believe the authors intended its use to be as an alternative to beam search, but I agree the two could be used together (beam search explores beam diversity, and contrastive search explores repetition avoidance).

Building it takes a significant time, and I haven't seen demand for it outside this issue -- we won't devote resources to it for now, as our bandwidth is limited. I would also oppose a PR, as it would add up to our long-term maintenance budget. If demand increases, I will revisit this decision :)

However, I have a short-term suggestion: have you tried the `repetition_penalty` argument in `generate`? ([docs](https://huggingface.co/docs/transformers/main/en/main_classes/text_generation#transformers.GenerationConfig.repetition_penalty))<|||||>Thanks. By the way, I tried increasing `repetition_penalty` in `generate` and it did help :)