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

Conversion from slow to fast for BPE spm vocabs contained an error. #10120

Merged
merged 3 commits into from Feb 13, 2021

Conversation

Narsil
Copy link
Contributor

@Narsil Narsil commented Feb 10, 2021

What does this PR do?

  • There is only 1 test currently (tokenizers + slow) that used the modified path
    and it's reformer, which does not contain any ids modification so the
    bug was silent for now.
  • The real issue is that vocab variable was overloaded by
    SentencePieceExtractor, leading to Slow specific vocab oddities to be
    completely ignored
  • The bug was reported here Model Hub hanging in model's loading #9518
  • Ran the complete tokenization test suite with slow without error
    (RUN_SLOW=1 pytest -sv tests/test_tokenization_*)
  • We need to keep in mind that BPE + SPM are relatively rare.
  • I still need to carry out
    a full sweep of the hub to check all possible variants.

Affected models (all repos containing sentencepiece.bpe.model):

  • Musixmatch/umberto-commoncrawl-cased-v1
  • idb-ita/gilberto-uncased-from-camembert
  • itsunoda/wolfbbsRoBERTa-large (not fixed with current PR, seems linked to prefixed '_' in fast tokenizers)
  • itsunoda/wolfbbsRoBERTa-small (not fixed with current PR)
  • mrm8488/umberto-wikipedia-uncased-v1-finetuned-squadv1-it
  • EMBEDDIA/litlat-bert
  • neuralspace-reverie/indic-transformers-bn-xlmroberta
  • neuralspace-reverie/indic-transformers-hi-xlmroberta

Fixes # (issue)

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?

@thomwolf @LysandreJik @sgugger

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

- There is only 1 test currently (tokenizers + slow) that used the modified path
and it's reformer, which does not contain any ids modification so the
bug was silent for now.
- The real issue is that vocab variable was overloaded by
SentencePieceExtractor, leading to Slow specific vocab oddities to be
completely ignored
- The bug was reported here huggingface#9518
- Ran the complete tokenization test suite with slow without error
(`RUN_SLOW=1 pytest -sv tests/test_tokenization_*`)
Copy link
Member

@n1t0 n1t0 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for fixing this @Narsil!

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.

Thanks for the fix!

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.

Great, LGTM! Thanks @Narsil!

@LysandreJik LysandreJik merged commit c9837a0 into huggingface:master Feb 13, 2021
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

4 participants