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

Add method to return attn-mask for HF Tokenizer. #60

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cptspacemanspiff
Copy link

So, I have been doing batched inference of things that use HF tokenizer. Your library is great, but does not expose the attention masks, which are useful when some of the inputs/outputs are padding.

This adds an additional tokenize method to the HF Tokenizer that returns both the token_ids and the attention masks.

It depends on my previous pull request, which separates out the hf cpp header declarations and the implementations.

#57

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.

1 participant