Examples: Tokenize only max_samples used for train/eval/prediction
# 🚀 Feature request

If I understand what's going on, when using flags for max samples to be used for train/eval/prediction, first the tokenizer is called on the whole dataset. This operations seems quite involved and it takes minutes for a decent size dataset. Is it possible to tokenize only max samples as defined by the corresponding parameters to save time?

## Motivation

I use the max sample flags to debug my code. It would be nice to just tokenize the samples that will be used instead of the whole dataset. 

I think this can be controlled from user level code. For example, in this line:
https://github.com/huggingface/transformers/blob/master/examples/pytorch/text-classification/run_glue.py#L394

modify the function to receive an argument on how many examples to tokenize. I'm guesstimating that the max samples param was recently introduced and older examples don't use it. I'll change the title of the issue to better reflect this. <|||||>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.<|||||>Sorry @ioana-blue, I had missed this issue - let me ping @sgugger for advice, but please note that he is off right now and will answer only when he's back. Thanks!<|||||>No worries, I think this can be controlled from the user space and I did so in my most recent code. I think the examples could be fixed as well as - at least - I use them for inspiration and they are great :) <|||||>You can just move the tokenization line after the datasets are truncated. It will take three lines instead of one since by then there will be three separate datasets instead of one, which is the main reason it's not done in the examples as they are, or they will become less readable.<|||||>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.