[Generate] Add bad words list argument to the generate function
Author: patrickvonplaten
Pull request: yes

The `bad_words_ids` argument allows to insert a list of lists of `input_ids` that cannot be generated, *e.g.* bad words. 

That's a proposed feature request (I think there were actually multiple ones):
#3061

Also adds tests for all language models to verify behavior. 

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

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

```diff
@@            Coverage Diff             @@
##           master    #3367      +/-   ##
==========================================
+ Coverage   77.80%   77.87%   +0.06%     
==========================================
  Files         100      100              
  Lines       17064    17127      +63     
==========================================
+ Hits        13277    13338      +61     
- Misses       3787     3789       +2     
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3367?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3367/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.98% <87.50%> (+0.17%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3367/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `88.63% <94.44%> (+0.47%)` | :arrow_up: |
| [src/transformers/configuration\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3367/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3V0aWxzLnB5) | `96.99% <100.00%> (+0.02%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/3367?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/3367?src=pr&el=footer). Last update [ae6834e...19d6acd](https://codecov.io/gh/huggingface/transformers/pull/3367?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Sadly, TF tensorflow test seems flaky see: https://github.com/huggingface/transformers/commit/b38d552a92a0a201c005afae0e1b861ae6de9ce0

Might need to revert the commit. 

@patrickvonplaten Could I please ask you a question about `bad_words_ids`? I am wondering, why is it made as `bad_words_ids` and not as `bad_words_list`? That is, why the parameter is devised to be a list of lists of token ids and not just a list of words as strings? Was it made so because of some implementation constraints? or is there some advantages for the user? Well, in other words, why is `bad_words_ids` better than `bad_words_list`? :slightly_smiling_face: 

The reason I am asking this is that I want to implement similar feature in another repository, and so would be very glad to hear you thoughts on the issue as the author who implemented this in transformers)

P.S. Sorry for intruding this PR with questions after several years since it was merged :sweat_smile: