a bug in transformers.GenerationMixin
### System Info

transformers 4.27.0. In the greedy_search method of the GenerationMixin class, the unfinished_sequences variable at line 2177 should be placed inside the body of the 'while' loop so that it gets longer and longer with the decoding, Otherwise it is always a value rather than a sequence.
@gante @gante 

### Who can help?

_No response_

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

while True:
     unfinished_sequences = input_ids.new(input_ids.shape[0]).fill_(1)
     if synced_gpus:
         pass 
         ba la ba la ...
   


### Expected behavior

Fix as soon as possible
Hey @lixinliu1995 👋  I'm not sure I follow, `unfinished_sequences` holds a boolean for each sentence and is updated each iteration on L2247 (if a sentence contains any of the eos tokens -> set to false)

How would you expect it to behave?<|||||>yeah, you are right. It is my mistake.<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.