torchtune
torchtune copied to clipboard
Loading mistral reward model checkpoints
See https://github.com/pytorch/torchtune/issues/812#issuecomment-2067790583 for context.
Context
What is the purpose of this PR? Is it to
- [x] add a new feature
- [ ] fix a bug
- [ ] update tests and/or documentation
- [ ] other (please add here)
Please link to any issues this PR addresses.
Changelog
What are the changes made in this PR?
I've added some lightweight logic in torchtune/utils/_checkpointing/_checkpointer.py
to support loading a mistral reward model from huggingface, and added a test case to ensure model weights are converted correctly.
Test plan
Please make sure to do each of the following if applicable to your PR. (If you're not sure about any one of these just ask and we will happily help.)
- [x] run pre-commit hooks and linters (make sure you've first installed via
pre-commit install
) - [x] add unit tests for any new functionality
- [ ] update docstrings for any new or updated methods or classes
- [x] run unit tests via
pytest tests
- [ ] run recipe tests via
pytest tests -m integration_test
- [ ] manually run any new or modified recipes with sufficient proof of correctness
- [ ] include relevant commands and any other artifacts in this summary (pastes of loss curves, eval results, etc.)
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/911
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:white_check_mark: No Failures
As of commit bded16a3bede4e05c04055aaa9ecc66e87665f1e with merge base f819b4b9963adab0fd1d4433e2a3f3953d9ff301 ():
:green_heart: Looks good so far! There are no failures yet. :green_heart:
This comment was automatically generated by Dr. CI and updates every 15 minutes.