documentation for modifying chat templates for assistant-only loss#4937
Open
jiosephlee wants to merge 2 commits intohuggingface:mainfrom
Open
documentation for modifying chat templates for assistant-only loss#4937jiosephlee wants to merge 2 commits intohuggingface:mainfrom
jiosephlee wants to merge 2 commits intohuggingface:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
While this issue is not super prevalent (most datasets are single-turn interactions and can be addressed with completion-only fine-tuning), some users want to fine-tune on multi-turn interactions or responses with tool-calling.
To my knowledge, this issue can be easily addressed with a proper chat template that adds {% generation %} when appropriate, including executed tool responses, so that the tokenizer returns the masks automatically. If the chat template doesn't do this, there is an ongoing PR to automatically address the issue with chat templates (#4900), but this doesn't scale well imo.
An easy solution would be to provide sufficient documentation so users can edit chat templates themselves!