subclassing a torch.utils.data.Dataset object for a T5 model
# 🚀 Feature request

In the example on the HuggingFace website "[Fine-tuning with custom datasets](https://huggingface.co/transformers/master/custom_datasets.html)" it says that for a custom dataset:

"_Now, let’s turn our labels and encodings into a Dataset object. In PyTorch, this is done by subclassing a torch.utils.data.Dataset object and implementing __len__ and __getitem__. In TensorFlow, we pass our input encodings and labels to the from_tensor_slices constructor method. We put the data in this format so that the data can be easily batched such that each key in the batch encoding corresponds to a named parameter of the forward() method of the model we will train._"

So the example provided is for distilbert classification but for a text to text model like T5 I got the error message when calling the trainer of "RuntimeError: Could not infer dtype of tokenizers.Encoding" 

So could you provide more documentation or links to guides to what needs to change for T5 and maybe for other models if needed?

## Motivation

Here is the code I had to change going from the distilbert example you provide to T5. I assume it works becomes the DataCollatorForSeq2Seq() takes care of expanding the labels/output encoding into the features needed by T5? (but I know very little, I am guessing and I can't find any documentation that suggests this kind of change is needed).

![Solution](https://user-images.githubusercontent.com/35327158/127994038-61c4a5e8-3ece-4b35-b164-0f38e8c6981d.png)


## Your contribution

<!-- Is there any way that you could help, e.g. by submitting a PR?
     Make sure to read the CONTRIBUTING.MD readme:
     https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md -->

This tutorial is out of date and will be rewritten soon. You should have a look at the [maintained examples](https://github.com/huggingface/transformers/tree/master/examples) or the [example notebooks](https://huggingface.co/transformers/notebooks.html) instead.<|||||>Thanks Sylvain, will do.