fix: chat_template masking due to truncation, consolidate turn build and keys within field #2123
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.
Description
This fixes cases where masking would fail for
chat_template
using the new behavior.Changes:
truncation
while applyingchat_template
as that would cut off conversation and affect masking downstream. We have another section that would drop long conversation already.- Removed defaultroles
within the prompter to not automatically map roles (in case users intend to keep the original names and wasn't aware we mapped) <- Comment needed for this design choice!roles_to_train
if it exist withinroles
. For example,roles_to_train: ["gpt"]
but the convo maps it all theassistant
leading to everything being ignored.turn
across modules and dropping off system prompt if done.should_train
TODO:
[ ] handlewe support nous tool calling dataset but not hf one for now.tool_calling
for assistant response for tools datasets[] discuss whether to revert removing defaulttemporarily revert for nowroles
[ ] update chat_template doc for explicitly specifyingroles
[ ] Fix tests to specifyroles
Motivation and Context
How has this been tested?
Test with Puffin dataset locally.
Screenshots (if appropriate)
Types of changes
Social Handles (Optional)