RuntimeError from fine-tuning the automodel
### System Info

- `transformers` version: 4.22.0.dev0
- Platform: Linux-5.4.0-110-generic-x86_64-with-glibc2.31
- Python version: 3.9.12
- Huggingface_hub version: 0.8.1
- PyTorch version (GPU?): 1.12.1+cu102 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: (True)
- Using distributed or parallel set-up in script?: (True)


### Who can help?

@LysandreJik

### Information

- [X] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

python run_mlm.py --model_name_or_path digitalepidemiologylab/covid-twitter-bert-v2 --train_file path_to_train_file --per_device_train_batch_size 8 --do_train --fp16 True --num_train_epochs 10 --save_steps 50000 --output_dir path_to_output

RuntimeError: The size of tensor a (1024) must match the size of tensor b (512) at non-singleton dimension 1

### Expected behavior

I am fine-tuning the language model on my own dataset (run_mlm.py without modification). It worked on bert-large-uncased model, but for model digitalepidemiologylab/covid-twitter-bert-v2, I received the following error: RuntimeError: The size of tensor a (1024) must match the size of tensor b (512) at non-singleton dimension 1.

Thank you for your help!
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/main/CONTRIBUTING.md) are likely to be ignored.