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

Enable padding_side as call time kwargs #33385

Merged
merged 11 commits into from
Sep 13, 2024

Conversation

zucchini-nlp
Copy link
Member

What does this PR do?

This PR adds padding_side as a valid kwargs when calling tokenizers, so that the users can set padding side when tokenizing. Is a follow-up from #32858 (comment), where we found that most processors accept padding_side but don't use it when tokenizing.

Added test for that and ran it for all models

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@zucchini-nlp
Copy link
Member Author

The failing test is not related to this PR, seems to be related to training datasets and tasks. PR is ready for review!

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Awesome - thanks for adding!

@yonigozlan
Copy link
Member

Looks good to me thanks @zucchini-nlp, this should unblock a lot of the kwargs uniformization PRs :). Anything blocking before this gets merged? Is it because of the tests failing?

@zucchini-nlp
Copy link
Member Author

zucchini-nlp commented Sep 12, 2024

I wanted to get @ArthurZucker 's review as well as this is tokenizers related. For tests I can rerun them and hope they won't fail this time

Copy link
Collaborator

@ArthurZucker ArthurZucker 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 to me!

@zucchini-nlp
Copy link
Member Author

Thanks, can someone merge pls as the tests won't pass after rerunning?

@amyeroberts
Copy link
Collaborator

@zucchini-nlp Yep - I can merge

@amyeroberts amyeroberts merged commit 4b0418d into huggingface:main Sep 13, 2024
22 of 24 checks passed
itazap pushed a commit to NielsRogge/transformers that referenced this pull request Sep 20, 2024
* fix

* add padding-side kwarg

* add padding side in all models & fix tests

* fix copies

* fix tests
amyeroberts pushed a commit to amyeroberts/transformers that referenced this pull request Oct 2, 2024
* fix

* add padding-side kwarg

* add padding side in all models & fix tests

* fix copies

* fix tests
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.

5 participants