Skip to content

fix(runners): call ensure_chat_template in load() for all runners#26

Merged
sacredvoid merged 1 commit into
mainfrom
fix/load-ensure-chat-template
Mar 26, 2026
Merged

fix(runners): call ensure_chat_template in load() for all runners#26
sacredvoid merged 1 commit into
mainfrom
fix/load-ensure-chat-template

Conversation

@sacredvoid
Copy link
Copy Markdown
Owner

Summary

  • Adds ensure_chat_template(self._tokenizer) to load() in SFTRunner, DPORunner, and GRPORunner
  • _load_model() already calls this, but load() was missing it
  • Fixes the common notebook pattern: train -> save -> reload -> inference fails with missing chat template

Fixes #25

Test plan

  • All 152 tests pass

load() was missing the ensure_chat_template() call that _load_model()
has. This caused the common notebook pattern of save-then-reload to
produce a tokenizer without a chat template, breaking any subsequent
apply_chat_template call.

Fixes #25
@sacredvoid sacredvoid merged commit d317e16 into main Mar 26, 2026
@sacredvoid sacredvoid deleted the fix/load-ensure-chat-template branch March 26, 2026 00:43
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.

Bug: Runner load() skips ensure_chat_template, breaking inference after reload

1 participant