DebertaV2 Modeling for SQUAD v2.0
Author: yazdanbakhsh
Pull request: no

### System Info

- `transformers` version: 4.24.0.dev0
- Platform: Linux-5.4.0-1087-gcp-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.7.5
- Huggingface_hub version: 0.10.1
- PyTorch version (GPU?): 1.9.0+cu111 (True)
- Tensorflow version (GPU?): 2.10.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: Yes
- Using distributed or parallel set-up in script?: No

### Who can help?

@LysandreJik
@sgugger

### Information

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

### Tasks

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

### Reproduction

python3 transformer-sparsity/examples/pytorch/question-answering/run_seq2seq_qa.py \
			--model_name_or_path microsoft/deberta-v3-large \
			--dataset_name squad_v2 \
			--context_column context \
			--question_column question \
			--answer_column answers \
			--do_train \
			--do_eval \
			--max_seq_length 512 \
			--doc_stride 128 \
			--warmup_ratio 0.2 \
			--per_device_train_batch_size 16 \
			--per_device_eval_batch_size 8 \
			--learning_rate 7e-6 \
			--num_train_epochs 3 \
			--version_2_with_negative \
			--label_names "start_positions", "end_positions" \
			--predict_with_generate \
			--load_best_model_at_end \
			--eval_steps ${eval_steps} \
			--save_steps ${eval_steps} \
			--evaluation_strategy steps \
			--logging_steps ${eval_steps} \
			--logging_strategy steps \
			--save_total_limit 5 \
			--metric_for_best_model "f1" \
			--greater_is_better true \
			--overwrite_output_dir \
			--output_dir ${ckpt_path} 2>&1 | tee ~/${ckpt_path}/finetune_run_$(date +"%Y_%m_%d_%I_%M_%p").log

### Expected behavior

I have used a similar script for SQUADv2 on other models (RoBERTa), but it seems this model is not registered properly in HF, hence the following error:

```
Traceback (most recent call last):
  File "transformer-sparsity/examples/pytorch/question-answering/run_seq2seq_qa.py", line 716, in <module>
    main()
  File "transformer-sparsity/examples/pytorch/question-answering/run_seq2seq_qa.py", line 380, in main
    use_auth_token=True if model_args.use_auth_token else None,
  File "/home/ayazdan/.local/lib/python3.7/site-packages/transformers/models/auto/auto_factory.py", line 467, in from_pretrained
    f"Unrecognized configuration class {config.__class__} for this kind of AutoModel: {cls.__name__}.\n"
ValueError: Unrecognized configuration class <class 'transformers.models.deberta_v2.configuration_deberta_v2.DebertaV2Config'> for this kind of AutoModel: AutoModelForSeq2SeqLM.
Model type should be one of BartConfig, BigBirdPegasusConfig, BlenderbotConfig, BlenderbotSmallConfig, EncoderDecoderConfig, FSMTConfig, LEDConfig, LongT5Config, M2M100Config, MarianConfig, MBartConfig, MT5Config, MvpConfig, PegasusConfig, PegasusXConfig, PLBartConfig, ProphetNetConfig, T5Config, XLMProphetNetConfig.
```

I made a quick fix to register the model, however another issue still exists, regarding the model itself.
```
Traceback (most recent call last):
  File "transformer-sparsity/examples/pytorch/question-answering/run_seq2seq_qa.py", line 716, in <module>
    main()
  File "transformer-sparsity/examples/pytorch/question-answering/run_seq2seq_qa.py", line 383, in main
    model.resize_token_embeddings(len(tokenizer))
  File "/home/ayazdan/.local/lib/python3.7/site-packages/transformers/configuration_utils.py", line 254, in __getattribute__
    return super().__getattribute__(key)
AttributeError: 'DebertaV2Config' object has no attribute 'resize_token_embeddings'
```



Comments:
Deberta is not a Seq2Seq model, you can't make a quick fix to enable its use with `run_seq2seq_qa`, as you have experienced it. Deberta has a model qith a QA head, so you will be able to use it with the regular `run_qa` script.

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.