Make retribert tokenizers independent from BertTokenizer
Author: Davidy22
Pull request: yes

Part of a series of commits to step towards resolving #19303

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [x] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? 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](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->


Comments:
_The documentation is not available anymore as the PR was closed or merged._

Are these line length check errors coming from the comments? Those are the only lines that approach the cusp of 119, and my editor tells me they're right under the line, and some of those comment lines come straight from the copied-from file

Took me enough tries, but finally passing checks. Would have saved myself a hefty bit of trouble if I had started with the styling tools.

I couldn't help but notice while going through the tools that `python utils/check_copies.py` will "correct" many existing files. Is this something that's intentionally held back? Does appear to pass checks without the inclusion of all those changes

Cleared up those little oversights.

Seems like the black version specified in setup.py is 22.3 and the one on my global python install is 22.6, so both should still be within the black project's promise of a yearly standard. The diff tells me that all the changes are just removing blank lines after function signatures or the first line of control flow blocks, which seems to be the usual black policy so I guess they just fixed some edge case that made it add a few empty lines mid-2022.

Also that failed check in a part of code that isn't changed is a bit annoying. `test_run_swag_no_trainer` seems to be building and testing a model, which I guess just failed as part of a stars aligning variance thing. I could change something superficial and invoke another CI run to confirm that I didn't stealth break a different module in a PR to make a module more independent, but the path does seem pretty separate.

This is because we are using the `--preview` flag, which breaks their promise of compatibility between the versions of the same year. We really like the way it formats all strings (in docstrings/warnings/multi-line strings in general) so we activated it. In three months, we'll switch to the 2023 version and remove the `--preview` flag, which should solve this issue for next year :-)

The failure is flaky indeed. Thanks a lot for your work on this!

I notice a little pile of deprecation warnings in that same leg of the test suite. If those aren't something that's being intentionally held back for compatibility reasons, I could put together another PR just mopping those up after all of the items from 19303 are cleared off or claimed

By all means! We are ignoring those for now, but we do need to clean them up at some point!