-
Notifications
You must be signed in to change notification settings - Fork 30.9k
Fix: Add Perceiver model registry test and correct auto mappings #41434
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
base: main
Are you sure you want to change the base?
Conversation
class PerceptionEncoder(PreTrainedModel): | ||
config_class = PretrainedConfig | ||
|
||
def __init__(self, config): | ||
super().__init__(config) | ||
self.dummy_layer = None | ||
|
||
def forward(self, x): | ||
return x | ||
|
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.
i don't think this is what we want to do. If the model does not exist, we should delete it from modeling_auto
which is the case for perception LM
|
||
class ParakeetCTCTokenizer(PreTrainedTokenizerBase): | ||
def __init__(self, vocab_file=None, **kwargs): | ||
super().__init__() | ||
self.vocab_file = vocab_file | ||
|
||
def _tokenize(self, text): | ||
return text.split() | ||
|
||
def _convert_token_to_id(self, token): | ||
return 0 | ||
|
||
def _convert_id_to_token(self, index): | ||
return "" |
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.
same here, we can set the slow tokenizer to None
if the model has only fast tokenizer (e..g see Chameleon)
I couldn't find the what I need to do... |
sorry, PerceiverLM was already fixed in another PR |
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, parakeet, perception_lm |
Summary
This PR adds testing and registry validation for the Perceiver model within the Hugging Face Transformers codebase.
Changes Made
test_registry.py
to validate Perceiver model registration and tokenizer mapping.perceiver
is properly recognized in:modeling_auto.py
tokenization_auto.py
PerceiverModel
with output shapetorch.Size([1, 256, 1280])
.input_channels
) to enable correct model instantiation.PerceiverTokenizer
.Verification