torchtune icon indicating copy to clipboard operation
torchtune copied to clipboard

Loading mistral reward model checkpoints

Open SalmanMohammadi opened this issue 9 months ago • 1 comments

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.)

SalmanMohammadi avatar May 01 '24 15:05 SalmanMohammadi

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/911

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 (image): :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.

pytorch-bot[bot] avatar May 01 '24 15:05 pytorch-bot[bot]