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

Please expose tonekizer params on models where forward_t is exposed #431

Open
HarryCaveMan opened this issue Oct 20, 2023 · 0 comments
Open

Comments

@HarryCaveMan
Copy link

HarryCaveMan commented Oct 20, 2023

If I want to use the SequenceClassifier pipeline for something like reranking, I am (sort of) able to do so using the exposed forward_t method. The problem is that I will need to first encode the inputs using the model's tokenizer. I can get a ref to the tokenizer using get_tokenizer, but if I want to pass in tokenizer params (IE max_len and device) to tokenizer.tokenize, I cannot get them from the SequenceClassificationModel, because they are private fields and there are not any get methods like there are for the tokenizer itself.

Alternatively, you could add a method to wrap calls to SequenceClassificationModel.tokenizer.tokenize and pass these parameter in from the model instance.

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

No branches or pull requests

1 participant