RuntimeError: The size of tensor a (716) must match the size of tensor b (512) at non-singleton dimension 1
## Environment info
<!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
     Don't forget to fill out the missing fields in that output! -->

- `transformers` version: 4.6.0.dev0
- Platform: windows 7
- Python version: 3.8.8
- PyTorch version (GPU?):
- Tensorflow version (GPU?): 2.4.1 (False)
- Using GPU in script?: No
- Using distributed or parallel set-up in script?: No

## Information

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

The problem arises when using:
* [√] the official example scripts: (give details below)
`python run_ner.py --model_name_or_path nlpaueb/legal-bert-base-uncased --train_file ***.json --validation_file ***.json --output_dir /tmp/*** --do_train --do_eval`

* [ ] my own modified scripts: (give details below)

The tasks I am working on is: NER
* [ ] an official GLUE/SQUaD task: (give the name)
* [√] my own task or dataset: (give details below)

## Error
`File "run_ner.py", line 504, in <module>
    main()
  File "run_ner.py", line 446, in main
    train_result = trainer.train(resume_from_checkpoint=checkpoint)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\trainer.py", line
1240, in train
    tr_loss += self.training_step(model, inputs)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\trainer.py", line
1635, in training_step
    loss = self.compute_loss(model, inputs)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\trainer.py", line
1667, in compute_loss
    outputs = model(**inputs)
  File "D:\Tool\Install\Python\lib\site-packages\torch\nn\modules\module.py", li
ne 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\models\bert\modeli
ng_bert.py", line 1679, in forward
    outputs = self.bert(
  File "D:\Tool\Install\Python\lib\site-packages\torch\nn\modules\module.py", li
ne 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\models\bert\modeli
ng_bert.py", line 964, in forward
    embedding_output = self.embeddings(
  File "D:\Tool\Install\Python\lib\site-packages\torch\nn\modules\module.py", li
ne 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "D:\Tool\Install\Python\lib\site-packages\transformers\models\bert\modeli
ng_bert.py", line 207, in forward
    embeddings += position_embeddings
RuntimeError: The size of tensor a (716) must match the size of tensor b (512) at non-singleton dimension 1
  5%|██▏                                      | 12/231 [03:07<56:54, 15.59s/i
t]`


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/master/CONTRIBUTING.md) are likely to be ignored.