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

Add split special tokens #30772

Merged
merged 21 commits into from
May 24, 2024
Merged

Add split special tokens #30772

merged 21 commits into from
May 24, 2024

Conversation

itazap
Copy link
Contributor

@itazap itazap commented May 13, 2024

What does this PR do?

Fixes #30685 #28648

Before submitting

  • make sure this is saved and used not only as kwargs but also the attribute
  • added tests
  • TODO: add docs

Edit:

  • Moved split_special_token testing to common tests, as it should be supported by both fast and slow models.
  • Verify fast and slow behaviour is identical
  • Tested with T5
  • Note: split_special_tokens is expected in kwargs

@itazap itazap requested a review from ArthurZucker May 13, 2024 09:58
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.

Good work! 🔥 congrats on your first PR totransformers

tests/tokenization/test_tokenization_utils.py Outdated Show resolved Hide resolved
tests/tokenization/test_tokenization_utils.py Outdated Show resolved Hide resolved
tests/tokenization/test_tokenization_fast.py Outdated Show resolved Hide resolved
@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.

@itazap itazap requested a review from ArthurZucker May 14, 2024 07:40
@ArthurZucker ArthurZucker force-pushed the add_split_special_tokens branch 3 times, most recently from 46fd0e4 to 9a65f9f Compare May 14, 2024 13:03
@itazap itazap marked this pull request as ready for review May 15, 2024 12:23
@itazap itazap requested a review from ArthurZucker May 15, 2024 12:23
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.

Cool! A few nits but overall LGTM

src/transformers/tokenization_utils_fast.py Show resolved Hide resolved
src/transformers/tokenization_utils_fast.py Outdated Show resolved Hide resolved
tests/test_tokenization_common.py Outdated Show resolved Hide resolved
tests/test_tokenization_common.py Outdated Show resolved Hide resolved
src/transformers/tokenization_utils_base.py Outdated Show resolved Hide resolved
tests/test_tokenization_common.py Outdated Show resolved Hide resolved
@itazap itazap requested a review from ArthurZucker May 15, 2024 15:28
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 good! thanks for adding this

tests/test_tokenization_common.py Outdated Show resolved Hide resolved
tests/test_tokenization_common.py Outdated Show resolved Hide resolved
@itazap itazap closed this May 24, 2024
@itazap itazap reopened this May 24, 2024
@itazap itazap merged commit deba765 into main May 24, 2024
23 checks passed
@itazap itazap deleted the add_split_special_tokens branch May 24, 2024 15:38
@itazap itazap restored the add_split_special_tokens branch May 24, 2024 16:04
@itazap itazap deleted the add_split_special_tokens branch May 27, 2024 11:38
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.

PreTrainedTokenizerFast._batch_encode_plus() got an unexpected keyword argument 'split_special_tokens'
3 participants