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

Remove token_type_ids from model_input_names (like #24788) #28325

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

Apsod
Copy link
Contributor

@Apsod Apsod commented Jan 3, 2024

What does this PR do?

Fixes an issue where the GPTSw3Tokenizer returns token_type_ids. These were not used in training and including them significantly degrades performance. This change is the same fix applied in #24788, which was later (erroneously?) reverted by #23909.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? 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, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@ArthurZucker @amyeroberts

Members/contributors who may be interested in your PR:
@DarioSucic @ekgren @bjornrun

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.

Thanks for fixing this!

Looks fine to me, but let's get a second approval from @ArthurZucker who might know more about reasons for it being added back in previously

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.

Hey! Thanks for the PR! Could you make sure all the slow test pass for this tokenizer as well? I have no idea why I added this again but I think a test must have been failing!

…d a model reference so that it points to an available model)
@Apsod
Copy link
Contributor Author

Apsod commented Jan 3, 2024

Thanks for the quick reply!
I ran the following:

RUN_SLOW=yes python -m pytest -n auto --dist=loadfile -s -v ./tests/models/gpt_sw3/test_tokenization_gpt_sw3.py

It did fail a test, namely an equality test where the reference output has token_type_ids.

It also (catastrophically) failed a test that referenced a closed model.

I've removed the offending token_type_ids in the equality check and updated the model reference to an openly available model. It now passes all tests.

@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.

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.

Thanks for the fix 🤗

@ArthurZucker ArthurZucker merged commit 45b1dfa into huggingface:main Jan 3, 2024
18 checks passed
staghado pushed a commit to staghado/transformers that referenced this pull request Jan 15, 2024
…huggingface#28325)

* remove token_type_ids from model_input_names (like huggingface#24788)

* removed test that assumed token_type_ids should be present and updated a model reference so that it points to an available model)
wgifford pushed a commit to wgifford/transformers that referenced this pull request Jan 21, 2024
…huggingface#28325)

* remove token_type_ids from model_input_names (like huggingface#24788)

* removed test that assumed token_type_ids should be present and updated a model reference so that it points to an available model)
AjayP13 pushed a commit to AjayP13/transformers that referenced this pull request Jan 22, 2024
…huggingface#28325)

* remove token_type_ids from model_input_names (like huggingface#24788)

* removed test that assumed token_type_ids should be present and updated a model reference so that it points to an available model)
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.

4 participants