Move GenerationMixin to separate file
Author: yjernite
Pull request: yes

This PR splits the `modeling_utils.py` and `modeling_tf_utils.py` by moving the code and methods related to generation to `modeling_generation.py` and `modeling_tf_generation.py` respectively.

Both of these files were getting pretty long, with the code dedicated to generation taking about 1000 LOC in each while being completely disjoint from the rest. This re-organization should make the code easier to read and contribute to.

There are no functional changes, I literally just created a new Mixin class for each and moved the functions as is.

Comments:
# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=h1) Report
> Merging [#5254](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/0267668c3d648c6e41afda97f5df8671ee880ac3&el=desc) will **increase** coverage by `0.52%`.
> The diff coverage is `77.79%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/5254/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #5254      +/-   ##
==========================================
+ Coverage   77.01%   77.53%   +0.52%     
==========================================
  Files         128      140      +12     
  Lines       21615    24334    +2719     
==========================================
+ Hits        16646    18868    +2222     
- Misses       4969     5466     +497     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/configuration\_albert.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2FsYmVydC5weQ==) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_ctrl.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2N0cmwucHk=) | `97.05% <ø> (ø)` | |
| [src/transformers/configuration\_distilbert.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2Rpc3RpbGJlcnQucHk=) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_encoder\_decoder.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2VuY29kZXJfZGVjb2Rlci5weQ==) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2dwdDIucHk=) | `97.22% <ø> (ø)` | |
| [src/transformers/configuration\_longformer.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2xvbmdmb3JtZXIucHk=) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX29wZW5haS5weQ==) | `97.14% <ø> (ø)` | |
| [src/transformers/configuration\_reformer.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3JlZm9ybWVyLnB5) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3JvYmVydGEucHk=) | `100.00% <ø> (ø)` | |
| [src/transformers/configuration\_t5.py](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3Q1LnB5) | `96.42% <ø> (ø)` | |
| ... and [159 more](https://codecov.io/gh/huggingface/transformers/pull/5254/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=footer). Last update [482a599...356e825](https://codecov.io/gh/huggingface/transformers/pull/5254?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Awesome, very much in favor of this change! 



I changed the name and mentioned the intended child class in the comment as suggested by @sshleifer 

I tried playing around with `importlib` to import `shape_list` dynamically from `modeling_tf_utils.py` but I'm getting stumped making it work with relative imports. Any suggestions / pointers @patrickvonplaten?

I also didn't see `importlib` used anywhere else for similar purposes so I feel a little uneasy about bringing in additional machinery to the lib :) 

> This is great! That cleans up the `modeling_(tf_)utils` a lot!
> 
> I'm thinking that `modeling_generation_utils.py` and `modeling_tf_generation_utils.py` would probably be better names. When I see this I'm thinking that `generation` is another model, rather than a utility file.
> 
> Pinging @thomwolf so he can give his opinion on introducing this mixin.

Changed the names :) 

I moved `shape_list` back to the main `modeling_tf_utils.py` (duplicated in `generation_tf_utils.py`) and renamed the files to Thom's suggestion. Should be ready to merge @LysandreJik !