Skip to content

Fix #34494 assistant tokens when truncated#34531

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

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

Conversation

@yonigottesman
Copy link
Copy Markdown
Contributor

@yonigottesman yonigottesman commented Oct 31, 2024

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
Copy link
Copy Markdown
Member

@Rocketknight1 Rocketknight1 left a comment

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

@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.

Copy link
Copy Markdown
Member

@LysandreJik LysandreJik left a comment

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!

@yonigottesman yonigottesman deleted the assistant_tokens_truncated branch November 6, 2024 04:19
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
)

* Fix assistant tokens when truncated

* fix test

* fix test

* step
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