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

Update KTO example with good dataset & chat format #1481

Merged
merged 2 commits into from Mar 25, 2024
Merged

Conversation

lewtun
Copy link
Member

@lewtun lewtun commented Mar 25, 2024

This PR removes the custom preprocessing that's applied with the Anthropic dataset in favour of:

  • A small, high quality dataset that's already suitable to apply a chat template to
  • A small, but good SFT model that has a chat template

The current script runs in about ~2' on a single node. The current set of hparams show margins going up / loss going down which is sufficient for a demo.

Screenshot 2024-03-25 at 16 25 08

kto_trainer.train()
kto_trainer.save_model(kto_args.output_dir)
kto_trainer.push_to_hub()
Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should put push_to_hub() in all our example scripts to track usage on the Hub

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@lewtun lewtun merged commit c4f0f41 into main Mar 25, 2024
9 checks passed
@lewtun lewtun deleted the update-kto-example branch March 25, 2024 15:56
lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
* Update KTO example with good dataset & chat format

* Add error for chat template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants