-
Notifications
You must be signed in to change notification settings - Fork 25.4k
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
[SigLIP] Add fast tokenizer #29969
base: main
Are you sure you want to change the base?
[SigLIP] Add fast tokenizer #29969
Conversation
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. |
# Copied from tests.models.t5.test_tokenization_t5.T5TokenizationTest.get_rust_tokenizer with T5->Siglip | ||
def get_rust_tokenizer(self, **kwargs) -> SiglipTokenizerFast: | ||
return self.rust_tokenizer_class.from_pretrained(self.tmpdirname, **kwargs) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the tests can be skipped as the tokenizer does lower case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which test can be skipped do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower_case
related test IMO
) | ||
|
||
return normalizers.Sequence(list_normalizers) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is, you are going to get also the MetaSpace
pre-tokenizer, but I am guessing this is also wanted
@ArthurZucker I'm down to these 3 tests failing:
but I don't really know how to fix these. Are you able to look into these? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_tokenization_python_rust_equals
is the only one you really need. The others are not well designed TBH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
|
||
self.vocab_file = vocab_file | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lots of copied from are missing here as well
# Copied from tests.models.t5.test_tokenization_t5.T5TokenizationTest.get_rust_tokenizer with T5->Siglip | ||
def get_rust_tokenizer(self, **kwargs) -> SiglipTokenizerFast: | ||
return self.rust_tokenizer_class.from_pretrained(self.tmpdirname, **kwargs) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower_case
related test IMO
@@ -544,6 +549,15 @@ def test_model_input_names_signature(self): | |||
# to make sure `tokenizer.pad(...)` works correctly | |||
self.assertTrue(tokenizer.model_input_names[0] in accepted_model_main_input_names) | |||
|
|||
def test_model_input_names_python_rust_equals(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good addition
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. |
is this getting merged anytime soon? |
Comments need to be adressed. cc @itazap if you want to take this over! |
What does this PR do?
Fixes #29925.
To do: