Skip to content

Commit

Permalink
patch processor
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Sayers <[email protected]>
  • Loading branch information
kylesayrs committed Jan 31, 2025
1 parent de38a64 commit afabe5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/llmcompressor/transformers/finetune/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@ def configure_processor(processor: Processor):
" when padding"
)

# the chat template attribute is required for saving, patch some processors which do
# no include this attribute (phi3_v)
processor_ct = getattr(processor, "chat_template", None)
tokenizer_ct = getattr(tokenizer, "chat_template", None)
if processor_ct is None and tokenizer_ct is not None:
processor.chat_template = tokenizer.chat_template


def main(
model_args: ModelArguments,
Expand Down

0 comments on commit afabe5a

Please sign in to comment.