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

Repeating an important warning in the chat template docs #31796

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

Rocketknight1
Copy link
Member

One important detail with chat templates is that they include all necessary special tokens, so if you apply them and then tokenize the text yourself, you should always use add_special_tokens=False. This is mentioned lower down in the template writing tips, but that's an advanced section, so I also added a tip about it further up to ensure people don't miss it.

@HuggingFaceDocBuilderDev

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

Good tip, maybe a bit hard to understand for non-native speakers; maybe add a TLDR: only specify apply_chat_template(tokenize=True)`?

docs/source/en/chat_templating.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for adding!

+1 on @LysandreJik's comment

@Rocketknight1
Copy link
Member Author

Reworded!

@Rocketknight1 Rocketknight1 merged commit e786844 into main Jul 5, 2024
9 checks passed
@Rocketknight1 Rocketknight1 deleted the tweak_chat_template_docs branch July 5, 2024 14:30
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.

4 participants