Bugs when trying to train a T5model from scratch in the run_summarization.py script
Author: xuyeliu
Pull request: no

## 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
- Platform: Macbook
- Python version: 3.7
- PyTorch version (GPU?):GPU
- Using GPU in script?:yes

### Who can help

Models:

- t5: @patrickvonplaten, @patil-suraj

Examples:

- maintained examples (from examples/pytorch/summarization): @sgugger, @patil-suraj

## Information

I am trying to train a t5 model from scratch without loading pre-trained weights.
I am not sure how to train a model from scratch using my custom CSV dataset through changing run_summarization.py script.

I got a bug with decoder input. How to specify decoder_inputs when using run_summarization.py.

Model I am using (T5):

The problem arises when using:
* [x] my own modified scripts: (give details below)

The tasks I am working on is:
* [x] my own task or dataset: (running a custom dataset, with one column "text" and one column "summary" in the customer CSV file)

## To reproduce

Steps to reproduce the behavior:

1. creating customed CSV data file as readme said
2. comment loading model weight script, and load a T5Model with config
3. using command : python examples/pytorch/summarization/run_summarization.py \
    --model_name_or_path t5-small\
    --do_train \
    --do_eval \
    --do_predict\
    --train_file coms_train.csv\
    --validation_file coms_val.csv\
    --test_file coms_test.csv\
    --source_prefix  "summarize: "\
    --output_dir ./t5_output \
    --per_device_train_batch_size=4 \
    --per_device_eval_batch_size=4 \
    --overwrite_output_dir \
    --predict_with_generate
<pre lang="python">
config = AutoConfig.from_pretrained(
    model_args.config_name if model_args.config_name else model_args.model_name_or_path,
    cache_dir=model_args.cache_dir,
    revision=model_args.model_revision,
    use_auth_token=True if model_args.use_auth_token else None,
)
tokenizer = AutoTokenizer.from_pretrained(
    model_args.tokenizer_name if model_args.tokenizer_name else model_args.model_name_or_path,
    cache_dir=model_args.cache_dir,
    use_fast=model_args.use_fast_tokenizer,
    revision=model_args.model_revision,
    use_auth_token=True if model_args.use_auth_token else None,
)
# model = AutoModelForSeq2SeqLM.from_pretrained(
#     model_args.model_name_or_path,
#     from_tf=bool(".ckpt" in model_args.model_name_or_path),
#     config=config,
#     cache_dir=model_args.cache_dir,
#     revision=model_args.model_revision,
#     use_auth_token=True if model_args.use_auth_token else None,
# )
model = T5Model(config = config)
</pre>
Bugs：
```{r}
  File "examples/pytorch/summarization/run_summarization.py", line 596, in <module>
    main()
  File "examples/pytorch/summarization/run_summarization.py", line 531, in main
    train_result = trainer.train(resume_from_checkpoint=checkpoint)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/transformers/trainer.py", line 1192, in train
    tr_loss += self.training_step(model, inputs)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/transformers/trainer.py", line 1590, in training_step
    loss = self.compute_loss(model, inputs)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/transformers/trainer.py", line 1622, in compute_loss
    outputs = model(**inputs)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/transformers/models/t5/modeling_t5.py", line 1343, in forward
    return_dict=return_dict,
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/leo/.pyenv/versions/3.7.7/lib/python3.7/site-packages/transformers/models/t5/modeling_t5.py", line 877, in forward
    raise ValueError(f"You have to specify either {err_msg_prefix}inputs or {err_msg_prefix}inputs_embeds")
ValueError: You have to specify either decoder_inputs or decoder_inputs_embeds
```
<!-- If you have code snippets, error messages, stack traces please provide them here as well.
     Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting
     Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.-->

## Expected behavior

I want to train T5model with my customer CSV dataset without loading pretrained weights. I only want to train their original model architecture without pre-trained model. Thanks!


Comments:
Hi there,

This is because you are using `T5Model`. When using `T5Model`, `decoder_input_ids` should be directly passed, but the examples pass `lables` which `T5Model` doesn't accept.

Also, for this task `T5ForConditionalGenerations` should be used instead of `T5Model`, it will take `lables` and prepare the `decoder_input_ids` by shifting the `labels`.



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.