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 deprecated properties in tokenization_nllb.py and tokenization_nllb_fast.py #29834

Merged
merged 20 commits into from
May 23, 2024

Conversation

ymoslem
Copy link
Contributor

@ymoslem ymoslem commented Mar 23, 2024

What does this PR do?

This PR fixes a typo in a warning in two tokenization files for the NLLB model. It changes adder_tokens_decoder into added_tokens_decoder and improves the warning's readability.

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?

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.

ymoslem added 2 commits March 23, 2024 19:43
Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.
Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.
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.

Hi @ymoslem, thanks for opening this PR!

What I would suggest is actually just removing these properties altogether, as they're deprecated and we're now on v4.39

ymoslem added 2 commits March 24, 2024 23:23
Remove deprecated attributes: `lang_code_to_id`, `fairseq_tokens_to_ids`, `id_to_lang_code`, and `fairseq_ids_to_tokens`
Remove deprecated attribute `lang_code_to_id`
@ymoslem ymoslem changed the title Fix typo in tokenization_nllb.py and tokenization_nllb_fast.py Remove deprecated properties in tokenization_nllb.py and tokenization_nllb_fast.py Mar 24, 2024
ymoslem added 2 commits March 24, 2024 23:40
Remove deprecated properties - fix format
Remove deprecated properties - fix format
@ymoslem
Copy link
Contributor Author

ymoslem commented Mar 25, 2024

Thanks @amyeroberts! Okay, I removed the deprecated properties, but some tests failed like this one. Should I edit it too?

def test_language_codes(self):
self.assertEqual(self.tokenizer.fairseq_tokens_to_ids["ace_Arab"], 256001)
self.assertEqual(self.tokenizer.fairseq_tokens_to_ids["ace_Latn"], 256002)
self.assertEqual(self.tokenizer.fairseq_tokens_to_ids["fra_Latn"], 256057)

@amyeroberts
Copy link
Collaborator

@ymoslem Yep - if we've deprecated a method, it's OK to remove from the tests here

@huggingface huggingface deleted a comment from github-actions bot Apr 25, 2024
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, are you still working on this? Could you rebase and fix the test so we can merge! 🤗

@ymoslem
Copy link
Contributor Author

ymoslem commented Apr 25, 2024

Hi @ArthurZucker I think it is fixed now. Please let me know if I should do something else. Thanks!

Copy link

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@ymoslem
Copy link
Contributor Author

ymoslem commented May 20, 2024

Review required.

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 updating!

@ArthurZucker
Copy link
Collaborator

COuld you rebase your branch to make sure we don't have any issues? 🤗

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

@ymoslem
Copy link
Contributor Author

ymoslem commented May 23, 2024

Now, it is synched with the latest repository. @ArthurZucker

@ArthurZucker
Copy link
Collaborator

can you push the merge here? 😉

@ArthurZucker ArthurZucker merged commit 6d3d5b1 into huggingface:main May 23, 2024
21 checks passed
@ArthurZucker
Copy link
Collaborator

Thanks!

itazap pushed a commit that referenced this pull request May 24, 2024
…_nllb_fast.py (#29834)

* Fix typo in tokenization_nllb.py

Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.

* Fix typo in tokenization_nllb_fast.py

Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.

* Remove deprecated attributes in tokenization_nllb.py

Remove deprecated attributes: `lang_code_to_id`, `fairseq_tokens_to_ids`, `id_to_lang_code`, and `fairseq_ids_to_tokens`

* Remove deprecated attribute in tokenization_nllb_fast.py

Remove deprecated attribute `lang_code_to_id`

* Remove deprecated properties in tokenization_nllb.py

Remove deprecated properties - fix format

* Remove deprecated properties in tokenization_nllb_fast.py

Remove deprecated properties - fix format

* Update test_tokenization_nllb.py

* update test_tokenization_nllb.py

* Update tokenization_nllb.py

* Update test_tokenization_seamless_m4t.py

* Update test_tokenization_seamless_m4t.py
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request Jun 11, 2024
…_nllb_fast.py (huggingface#29834)

* Fix typo in tokenization_nllb.py

Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.

* Fix typo in tokenization_nllb_fast.py

Change `adder_tokens_decoder` into `added_tokens_decoder` and improve the warning's readability.

* Remove deprecated attributes in tokenization_nllb.py

Remove deprecated attributes: `lang_code_to_id`, `fairseq_tokens_to_ids`, `id_to_lang_code`, and `fairseq_ids_to_tokens`

* Remove deprecated attribute in tokenization_nllb_fast.py

Remove deprecated attribute `lang_code_to_id`

* Remove deprecated properties in tokenization_nllb.py

Remove deprecated properties - fix format

* Remove deprecated properties in tokenization_nllb_fast.py

Remove deprecated properties - fix format

* Update test_tokenization_nllb.py

* update test_tokenization_nllb.py

* Update tokenization_nllb.py

* Update test_tokenization_seamless_m4t.py

* Update test_tokenization_seamless_m4t.py
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