-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
apply_chat_template: consistent behaviour for return_assistant_tokens_mask=True return_tensors=True #35582
apply_chat_template: consistent behaviour for return_assistant_tokens_mask=True return_tensors=True #35582
Conversation
406d7bf
to
d79b446
Compare
…assistant_tokens_mask flag
…ith no attention mask
… no padding token
eb47736
to
7349d16
Compare
Hi! Take a look, please |
Hi @mrsndmn, I'm sorry we missed this PR! @yonigottesman can you take a look? It's okay if you don't have time - just let me know and I can take it instead |
Hey @yonigottesman, just checking in — did you have a chance to look at this PR? No rush, but let me know if you need anything from me! |
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.
LGTM let's merge 🤗
…_mask=True return_tensors=True (huggingface#35582) * apply_chat_template: consistent return_tensors behaviour with return_assistant_tokens_mask flag * test_chat_template_return_assistant_tokens_mask: support tokenizers with no attention mask * test_chat_template_return_assistant_tokens_mask: skip tokenizers with no padding token * test_chat_template_return_assistant_tokens_mask: force tokenizer padding_side=right --------- Co-authored-by: Eduard Allakhverdov <goncharova@airi.net> Co-authored-by: d.tarasov <d.tarasov@airi.net>
…_mask=True return_tensors=True (huggingface#35582) * apply_chat_template: consistent return_tensors behaviour with return_assistant_tokens_mask flag * test_chat_template_return_assistant_tokens_mask: support tokenizers with no attention mask * test_chat_template_return_assistant_tokens_mask: skip tokenizers with no padding token * test_chat_template_return_assistant_tokens_mask: force tokenizer padding_side=right --------- Co-authored-by: Eduard Allakhverdov <goncharova@airi.net> Co-authored-by: d.tarasov <d.tarasov@airi.net>
What does this PR do?
This PR fixes the simultaneous use of flags
return_assistant_tokens_mask
,return_tensors
, inapply_chat_template
method.Is related to #28950 and corresponding PR #30650
Before fix
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.
@yonigottesman @amyeroberts @Rocketknight1