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

fix: chat_template masking due to truncation, consolidate turn build and keys within field #2123

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

NanoCode012
Copy link
Collaborator

@NanoCode012 NanoCode012 commented Dec 5, 2024

Description

This fixes cases where masking would fail for chat_template using the new behavior.

Changes:

  • Remove truncation while applying chat_template as that would cut off conversation and affect masking downstream. We have another section that would drop long conversation already.
    - Removed default roles 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!
  • Map roles_to_train if it exist within roles. For example, roles_to_train: ["gpt"] but the convo maps it all the assistant leading to everything being ignored.
  • Consolidates building turn across modules and dropping off system prompt if done.
  • Refactors should_train
  • Optimize handling of matching tokens in a turn
  • Explicitly truncates chat_template for reward model Bradleyterry. Previously, this was silently truncating.

TODO:

  • [ ] handle tool_calling for assistant response for tools datasets we support nous tool calling dataset but not hf one for now.
  • [] discuss whether to revert removing default roles temporarily revert for now
  • [ ] update chat_template doc for explicitly specifying roles
  • [ ] Fix tests to specify roles

Motivation and Context

How has this been tested?

Test with Puffin dataset locally.

Screenshots (if appropriate)

Types of changes

Social Handles (Optional)

@NanoCode012 NanoCode012 marked this pull request as ready for review December 9, 2024 07:19
@winglian winglian merged commit 5d6b088 into main Dec 9, 2024
12 checks passed
@winglian winglian deleted the fix/chat_template_mask branch December 9, 2024 18:49
djsaunde pushed a commit that referenced this pull request Dec 16, 2024
…and keys within field (#2123) [skip ci]

* fix: chat_template masking due to truncation, consolidate turn build and keys within field

* fix: revert roles change

* fix: handling of training and training_detail

* fix: do not skip setting eos mask even if failed finding turn boundary

* fix: truncate reward modelling outputs
djsaunde pushed a commit that referenced this pull request Dec 17, 2024
…and keys within field (#2123) [skip ci]

* fix: chat_template masking due to truncation, consolidate turn build and keys within field

* fix: revert roles change

* fix: handling of training and training_detail

* fix: do not skip setting eos mask even if failed finding turn boundary

* fix: truncate reward modelling outputs
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.

2 participants