Add models special tokens to its pretrained configs
Author: patrickvonplaten
Pull request: yes

I think the token_ids for each specific model should also be added to their pretrain configs. This would also make the function generate() much easier to use for the user. 

If ok, I can also add these tokens for models not having a LMHead.

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

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

```diff
@@            Coverage Diff             @@
##           master    #3011      +/-   ##
==========================================
- Coverage   77.25%   76.22%   -1.03%     
==========================================
  Files          98       98              
  Lines       16040    16048       +8     
==========================================
- Hits        12392    12233     -159     
- Misses       3648     3815     +167
```


| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/3011?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [src/transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `92.05% <ø> (-0.33%)` | :arrow_down: |
| [src/transformers/configuration\_xlm.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3hsbS5weQ==) | `96.36% <100%> (+0.13%)` | :arrow_up: |
| [src/transformers/configuration\_gpt2.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX2dwdDIucHk=) | `97.22% <100%> (+0.16%)` | :arrow_up: |
| [src/transformers/configuration\_transfo\_xl.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3RyYW5zZm9feGwucHk=) | `92.59% <100%> (+0.13%)` | :arrow_up: |
| [src/transformers/configuration\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9jb25maWd1cmF0aW9uX3hsbmV0LnB5) | `93.87% <100%> (+0.39%)` | :arrow_up: |
| [src/transformers/modeling\_tf\_pytorch\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9weXRvcmNoX3V0aWxzLnB5) | `8.72% <0%> (-81.21%)` | :arrow_down: |
| [src/transformers/modeling\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yb2JlcnRhLnB5) | `85.71% <0%> (-10%)` | :arrow_down: |
| [src/transformers/modeling\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `73.48% <0%> (-2.3%)` | :arrow_down: |
| [src/transformers/modeling\_ctrl.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19jdHJsLnB5) | `96.03% <0%> (-2.21%)` | :arrow_down: |
| [src/transformers/modeling\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `80.2% <0%> (-1.35%)` | :arrow_down: |
| ... and [1 more](https://codecov.io/gh/huggingface/transformers/pull/3011/diff?src=pr&el=tree-more) | |

------

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


Isn’t this duplicating info that’s already in the tokenizers?

@julien-c yeah it's duplicating information. 

The main reason I added them is because when calling the function `model.generate()` one always has to put the special token ids into the function with:
`model.generate(pad_token_id=tokenizer.pad_token_id, ...)` 

The second reason was that every pretrained model already has the attributes `pad_token_id`, `eos_token_id` and `bos_token_id` which are just set to None no matter which pretrained model is loaded. 

Or we could just delete the attributes pad_token_id from the config - I think the generate() function is anyways the only function using self.config.pad_token_id


maybe the `generate()` method should actually be a pipeline? cf. the `FillMaskPipeline`?

Ok, I see your point! Should we maybe then also delete the self.pad_token_id, self.eos_token_id and self.bos_token_id in https://github.com/huggingface/transformers/blob/5bc99e7f33c83b23b88740877283098ef7964b73/src/transformers/configuration_utils.py#L78

So that it is clear that the tokens are no attribute of the models at all. @julien-c & @LysandreJik 

Yes, I think that would make sense. Are these used anywhere?

They are only used in the generate() function, but since there is also a pad_token_id argument to the function, they are not needed at all. I will open a new PR to delete them. 

As I mentioned before, I feel like we should go toward having a single configuration file for both models and tokenizers (at least for pretrained model, for newly initialized model this may imply forcing the user to supply a configuration object when creating the model/tokenizer).

In this case I don't see any problem with having token_id attributes in this configuration file that the model could use, this doesn't means we are gathering tokenizer and model, just that they are depending on a single configuration object.

I do agree that we need to think this carefully though.