Fix warning situation: UserWarning: max_length is ignored when padding=True"
Author: shirayu
Pull request: yes

# What does this PR do?

Fixes #13826


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/master/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/master/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

@sgugger @LysandreJik 

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->


Comments:
The change looks good to me.

> I don't think the warning should be just completely removed as it has some importance. We could check the `truncation` argument`and leave the warning if it's not set to`True`.

You mean `truncation=False` and `max_length=10` => Should that not raise another warning, that `max_length` is ignored when you have set `truncation` to `False`.

I would argue that `max_length` and `padding=True` has no connection => hence, create no warning

I don't think users are confused by what is happening when `truncation=False`, they are confused by what happens when `padding=True`. Remember that most users don't read the doc so they don't know `padding=True` means "longest" and not "max length".

> I don't think users are confused by what is happening when `truncation=False`, they are confused by what happens when `padding=True`. Remember that most users don't read the doc so they don't know `padding=True` means "longest" and not "max length".

Yes, that makes sense.

So this warning can be raised when `truncation == False or truncation == 'do_not_truncate'`

Thank you for your comments.
I updated the code and title.