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

Refine parameter type annotations #36644

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

flashJd
Copy link

@flashJd flashJd commented Mar 11, 2025

What does this PR do?

Fixes # (issue)
This PR refines the parameter type annotations in the add_tokens and add_special_tokens methods.special_tokens_dict parameter accept list or tuple when key is additional_special_tokens, but parameter type not covered.
The goal is to make the parameter type more clear

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.

Copy link

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the Ready for review button (at the bottom of the PR page).

@github-actions github-actions bot marked this pull request as draft March 11, 2025 10:09
@flashJd flashJd marked this pull request as ready for review March 11, 2025 10:34
@github-actions github-actions bot requested a review from ArthurZucker March 11, 2025 10:35
Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

Yep, this looks correct. Thank you for the PR!

@flashJd
Copy link
Author

flashJd commented Mar 12, 2025

I checked the tests failure:
test_eager_matches_sdpa_inference_1_bfloat16 failure has nothing to do with my code changes
test_add_special_tokens failed because of https ReadTimeout, I run the test local and passed.

python -m unittest tests.models.nougat.test_tokenization_nougat.NougatTokenizationTest.test_add_special_tokens Ran 1 test in 3.781s OK

@Rocketknight1
Copy link
Member

Yes, these test failures are unrelated - we're fixing the CI issue internally, so hopefully we can rebase and merge this PR afterwards!

@Rocketknight1
Copy link
Member

Hi @flashJd, I think everything should be solved by rebasing onto the latest version of main and force pushing but the Github interface is acting strangely. Can you do the rebase/force push manually and ping me to merge this?

@flashJd
Copy link
Author

flashJd commented Mar 25, 2025

I've rebased the main branch, @Rocketknight1

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