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

[megatron] fix: critic and reward model load tokenizer from config #301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HollowMan6
Copy link

Currently, the worker will fail if the critic or reward model path doesn't contain a tokenizer. This PR tries to fix this by loading tokenizer from the config for the previously mentioned case.

  • For the critic model, we fall back to load from critic.model.tokenizer_path.
  • For the reward model, we first fall back to load from reward_model.model.rm_tokenizer, and then reward_model.model.input_tokenizer if that is not set.

@HollowMan6 HollowMan6 force-pushed the tokenizer branch 2 times, most recently from 9c51e60 to ab24a03 Compare February 19, 2025 08:02
@HollowMan6
Copy link
Author

Just fixed the yapf formatting issue

Currently, the worker will fail if the critic or reward model path
doesn't contain a tokenizer. This PR tries to fix this by loading
tokenizer from the config for the previously mentioned case.

- For the critic model, we fall back to load from
  `critic.model.tokenizer_path`.
- For the reward model, we first fall back to load from
  `reward_model.model.rm_tokenizer`, and then
  `reward_model.model.input_tokenizer` if that is not set.

Signed-off-by: Hollow Man <[email protected]>
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.

2 participants