Trainer model __init__() got an unexpected keyword argument 'prediction_loss_only'
## Environment info

- `transformers` version: 4.15.0
- Platform: Linux-4.18.0-193.19.1.el8_2.x86_64-x86_64-with-centos-8.2.2004-Core
- Python version: 3.6.13
- PyTorch version (GPU?): 1.10.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?: <fill in>
- Using distributed or parallel set-up in script?: <fill in>

### Who can help
@sgugger

## Information
Model I am using is BERT.  
The problem arises when using:
* [ ] the official example scripts: (give details below)
cd examples/legacy/
export CUDA_VISIBLE_DEVICES=0
export TRAIN_FILE=data/source
export TEST_FILE=data/source
python run_language_modeling.py \
    --output_dir=chinese_finetuned_lm \
    --model_type=bert \
    --model_name_or_path=bert-base-chinese \
    --do_train \
    --train_data_file=$TRAIN_FILE \
    --do_eval \
    --eval_data_file=$TEST_FILE \
    --mlm

The tasks I am working on is:
* [ ] Finetuning a language model based on bert-base-chinese model.

## To reproduce

Steps to reproduce the behavior:

1.prepare bert-base-chinese model.
2.prepare data/source file(A pure Chinese text).
3.run run_language_modeling.py

Traceback (most recent call last):
  File "run_language_modeling.py", line 364, in <module>
    main()
  File "run_language_modeling.py", line 318, in main
    prediction_loss_only=True,
TypeError: __init__() got an unexpected keyword argument 'prediction_loss_only'

## Expected behavior
No error.

You are using a legacy script with a recent version of Transformers, this is not going to work. You should use a version of Transformers compatible with that script, or use one of our maintained examples.<|||||>I had the same issue and solved by using an older release: `pip install transformers==v3.4.0`
@atptour2017, just in case that works for you too.  <|||||>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.