[generate] return past_key_values
# What does this PR do?

Allows returning `past_key_values` from `generate` when `use_cache=True`.

Like other returned values, `past_key_values` are also returned as `Tuple`, one element per generated token.

Fixes #17016
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_17574). All of your documentation changes will be reflected on that endpoint.<|||||>We'll just need to fix the failing tests now :-) Think you'll have to overwrite this "checking" function in the respective individual test files<|||||>Hey there, sorry to nag, but any chance of moving this along? Anything I can do to help?<|||||>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.<|||||>(@patrickvonplaten @patil-suraj should I take over this PR? :) )<|||||>If ok for you @gante this would be amazing!<|||||>Hi, Thank you all for working on this feature! Is this going to be merged into the main branch soon?<|||||>@shunzh I haven't started working on it and it's hard to give estimates -- hopefully less than a month :)<|||||>Was this closed because it's now possible to retrieve `past_key_values` or was there another reason?<|||||>@gilljon it is not closed :)<|||||>@gante I'm sorry for the confusion! Any idea when it will be merged?<|||||>hi @gante . Any idea when this will be merged? Interested in using it and building something on top of it. I'll happy to put on the finishing touches if needed too!<|||||>Hey! Just a friendly reminder. Any chance to get it merged soon?