Loss is calculated on all tokens, including padding, in the LM fine-tuning example
# 🐛 Bug
The BERT fine-tuning example uses a special index to mark ignored locations for the loss function:
`loss_fct = CrossEntropyLoss(ignore_index=-1)`
While in the same example, the masking function that samples locations to be included or excluded uses a different index: -100 (which is the default ignored index for the cross-entropy loss function, if one is not supplied):
`labels[~masked_indices] = -100  # We only compute loss on masked tokens`

Model I am using (Bert, XLNet ...): All models.

Language I am using the model on (English, Chinese ...): All languages

The problem arises when using:
* [X] the official example scripts: (give details below)
* [ ] my own modified scripts: (give details below)

The tasks I am working on is:
* [X] an official GLUE/SQUaD task: LM Finetuning
* [ ] my own task or dataset: (give details below)

## Expected behavior
Loss should be computed only on the 15% (mlm_probability) of sampled tokens.
     
- `transformers` version: 2.3, 2.4

Hello, `BertForMaskedLM` [does not use an ignore index set to -1](https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_bert.py#L1018), nor does any other models.

It was updated in [2.4.0](https://github.com/huggingface/transformers/releases/tag/v2.4.0). The scripts should be run against the latest version of the library.

If you want to run against v2.3.0, please use a script from v2.3.0, for example [run_lm_finetuning](https://github.com/huggingface/transformers/blob/v2.3.0/examples/run_lm_finetuning.py).<|||||>You're right, I mixed up the versions. closing the issue.