Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] Add Tulu3 SFT Mixture Dataset Support #1381

Merged
merged 5 commits into from
Feb 12, 2025

Conversation

bwalshe
Copy link
Contributor

@bwalshe bwalshe commented Feb 5, 2025

Description

This adds support for the Tülu 3 SFT Mixture dataset. (https://huggingface.co/datasets/allenai/tulu-3-sft-mixture)

Currently this PR is a work in progress, as I am unsure what testing process is needed and also what would make a suitable example config for demonstrating the dataset in use. I have included some basic unit tests, and the example config demonstrates the data being used in fine-tuning, but it serves more as a test things are working instead of being a good demonstration of what to do with the data.

Related issues

Fixes #1361

Before submitting

  • This PR only changes documentation. (You can ignore the following checks in that case)
  • Did you read the contributor guideline Pull Request guidelines?
  • Did you link the issue(s) related to this PR in the section above?
  • Did you add / update tests where needed?

Reviewers

At least one review from a member of oumi-ai/oumi-staff is required.

@@ -0,0 +1,37 @@
model:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@taenin taenin 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 the contribution, bwalshe! Overall things look good. I left a few small style comments.

The location you chose for your config is fine for a demonstration. If you've tuned parameters and get good results, I'd add it to the recipes section instead.

tests/unit/datasets/test_tulu3_sft_mixtrue.py Outdated Show resolved Hide resolved
src/oumi/datasets/sft/tulu3_sft_mixture.py Outdated Show resolved Hide resolved
@taenin taenin requested review from wizeng23 and xrdaukar February 5, 2025 23:57
@bwalshe bwalshe marked this pull request as ready for review February 6, 2025 13:40
Copy link
Collaborator

@taenin taenin left a comment

Choose a reason for hiding this comment

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

One more small issue that came up when running pytest.

Comment on lines 48 to 49
raise ValueError(f"Unknown role {e.args[0]}, was expecting one of {
roles.keys()}") from e
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
raise ValueError(f"Unknown role {e.args[0]}, was expecting one of {
roles.keys()}") from e
raise ValueError(f"Unknown role {e.args[0]}, was expecting one of "
f"{roles.keys()}") from e

return Message(role=role, content=content)
except KeyError as e:
raise ValueError(
f"Unknown role {message['role']}, "
Copy link
Collaborator

@xrdaukar xrdaukar Feb 7, 2025

Choose a reason for hiding this comment

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

Technically message['role'] can throw another exception if 'role' is not in message.

How about pre-computing the value once at the beginning of the function:
role_str = message["role"].lower().strip()
?

@taenin taenin merged commit 0bf30b2 into oumi-ai:main Feb 12, 2025
2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add Tulu3 SFT/DPO Mixture Dataset Support
3 participants