Skip to content

Enable padding_side as call time kwargs#33385

Merged
amyeroberts merged 11 commits into
huggingface:mainfrom
zucchini-nlp:padding-side
Sep 13, 2024
Merged

Enable padding_side as call time kwargs#33385
amyeroberts merged 11 commits into
huggingface:mainfrom
zucchini-nlp:padding-side

Conversation

@zucchini-nlp

Copy link
Copy Markdown
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

Copy link
Copy Markdown

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
Copy Markdown
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!

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

zucchini-nlp commented Sep 12, 2024

Copy link
Copy Markdown
Member Author

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

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Member Author

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

@amyeroberts

Copy link
Copy Markdown
Contributor

@zucchini-nlp Yep - I can merge

@amyeroberts
amyeroberts merged commit 4b0418d into huggingface:main Sep 13, 2024
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 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