Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn for unexpected argument combinations #13509

Merged
merged 4 commits into from
Sep 24, 2021
Merged

Warn for unexpected argument combinations #13509

merged 4 commits into from
Sep 24, 2021

Conversation

shirayu
Copy link
Contributor

@shirayu shirayu commented Sep 10, 2021

What does this PR do?

Warn for unexpected argument combinations:

  • padding is True and max_length is not None
  • padding is True and pad_to_max_length is not False

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@shirayu shirayu changed the title Warn for unexpected argument combinations [WIP] Warn for unexpected argument combinations Sep 10, 2021
@shirayu shirayu changed the title [WIP] Warn for unexpected argument combinations Warn for unexpected argument combinations Sep 10, 2021
@shirayu shirayu closed this Sep 10, 2021
@shirayu shirayu reopened this Sep 10, 2021
@shirayu
Copy link
Contributor Author

shirayu commented Sep 23, 2021

@sgugger
Could you review this PR?
Thank you.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good on my side! Thanks a lot for your PR!

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a small modification of the second warning :)

src/transformers/tokenization_utils_base.py Outdated Show resolved Hide resolved
@LysandreJik LysandreJik merged commit 66b01ce into huggingface:master Sep 24, 2021
@shirayu shirayu deleted the warn_unexpected_combination branch September 24, 2021 16:12
stas00 pushed a commit to stas00/transformers that referenced this pull request Oct 12, 2021
* Warn for unexpected argument combinations

* Updated the waning message for pad_to_max_length
Albertobegue pushed a commit to Albertobegue/transformers that referenced this pull request Jan 13, 2022
* Warn for unexpected argument combinations

* Updated the waning message for pad_to_max_length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants