This repository was archived by the owner on Nov 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
feat: support new DPO data format and update SFT config to use override API #405
Merged
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
terrykong
suggested changes
Nov 15, 2024
terrykong
suggested changes
Nov 21, 2024
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODOs
- compatbility test
- Stretch (update the dpo.sh template test script to convert the train data json into this new format)
terrykong
reviewed
Nov 21, 2024
terrykong
reviewed
Nov 21, 2024
d32515c to
a112c19
Compare
Signed-off-by: Terry Kong <terryk@nvidia.com>
a112c19 to
0d3b8ee
Compare
Collaborator
|
closing in favor of #403 |
Signed-off-by: arendu <adithya.r@gmail.com>
for more information, see https://pre-commit.ci Signed-off-by: NeMo-Aligner CI <nemo-aligner-ci@nvidia.com>
terrykong
previously approved these changes
Dec 3, 2024
8 tasks
Signed-off-by: arendu <adithya.r@gmail.com>
…NeMo-Aligner into adithyare/dpo_data_refac
terrykong
approved these changes
Dec 4, 2024
terrykong
added a commit
that referenced
this pull request
Dec 5, 2024
…de API (#405) Signed-off-by: Terry Kong <terryk@nvidia.com> Signed-off-by: arendu <adithya.r@gmail.com> Signed-off-by: NeMo-Aligner CI <nemo-aligner-ci@nvidia.com> Co-authored-by: Terry Kong <terryk@nvidia.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Signed-off-by: Terry Kong <terryk@nvidia.com>
ccclyu
reviewed
Dec 5, 2024
|
|
||
| return output_dict | ||
|
|
||
| def convert(self, messages): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it can support apply_chat_template (https://huggingface.co/docs/transformers/main/en/chat_templating) for huggingface tokenizers that are adapted in most open-sourced LLMs?
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 ?
This PR makes the dpo dataset use chat format tokens from the model's config yaml instead of hardcoding chat/special tokens in the jsonl data file.
Currently, each datapoint inside a DPO jsonl data file, looks like this:
With this PR it should be like this (OpenAI list of messages format with no chat/formatting tokens):
Additionally There is a script added to convert old data files into the new format.
A new file will be written in the same location as the old format file.
Changelog
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Checklist when contributing a new algorithm
max_steps=-1andvalidation?Additional Information