Hi,
Thanks for reporting. This has been reported before (see this 2).This probably has to do with the settings of the generate() method, which uses greedy decoding by default. Note that the original implementation uses beam search.
Greedy decoding usually does a lot of repetition, so for tasks like TrOCR one should consider beam-search. And to avoid repetition, one could use the no_repeat_ngram_size argument. One should also set the right max_length and min_length.
I’ll investigate this a bit. Feel free to experiment with the settings of the generate method.