Add tokenizer fallback for chat_template sync
This commit is contained in:
parent
36c9a841eb
commit
fbdb3b524e
1 changed files with 1 additions and 1 deletions
|
|
@ -700,7 +700,7 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"):
|
|||
vllm_chat_template_sync = (
|
||||
"if hasattr(self, 'llm') and self.llm is not None and hasattr(self.llm, 'get_tokenizer'):\n"
|
||||
" _vllm_tok = self.llm.get_tokenizer()\n"
|
||||
" _pc = getattr(self, 'processing_class', None)\n"
|
||||
" _pc = getattr(self, 'processing_class', None) or getattr(self, 'tokenizer', None)\n"
|
||||
" if _pc is not None and getattr(_pc, 'chat_template', None) is not None:\n"
|
||||
" if _vllm_tok.chat_template is None:\n"
|
||||
" _vllm_tok.chat_template = _pc.chat_template\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue