Skip to content

Fix #34494 assistant tokens when truncated - #34531

Merged
Rocketknight1 merged 4 commits into
huggingface:mainfrom
yonigottesman:assistant_tokens_truncated
Nov 5, 2024
Merged

Fix #34494 assistant tokens when truncated#34531
Rocketknight1 merged 4 commits into
huggingface:mainfrom
yonigottesman:assistant_tokens_truncated

Conversation

@yonigottesman

@yonigottesman yonigottesman commented Oct 31, 2024

Copy link
Copy Markdown
Contributor

This pr fixes a bug that caused #34494.
when using apply_chat_template with return_assistant_tokens_mask and token truncation, the assistant mask was not correct.

@Rocketknight1

@yonigottesman yonigottesman changed the title Fixs #3449 assistant tokens when truncated Fix #3449 assistant tokens when truncated Oct 31, 2024
@yonigottesman yonigottesman changed the title Fix #3449 assistant tokens when truncated Fix #34494 assistant tokens when truncated Oct 31, 2024
Comment thread src/transformers/tokenization_utils_base.py Outdated

@Rocketknight1 Rocketknight1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this makes sense to me now, and the tests are helpful! Thank you!

cc @LysandreJik for core maintainer review

Comment thread src/transformers/tokenization_utils_base.py Outdated
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

@LysandreJik LysandreJik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, impressive test! Thanks @yonigottesman

@yonigottesman
yonigottesman force-pushed the assistant_tokens_truncated branch from f225fdb to 9024b7a Compare November 5, 2024 14:21
@yonigottesman

Copy link
Copy Markdown
Contributor Author

rebased and ready for merge...

@Rocketknight1
Rocketknight1 merged commit 082e57e into huggingface:main Nov 5, 2024
@Rocketknight1

Copy link
Copy Markdown
Member

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants