mirror of
https://github.com/wassname/alignment-handbook.git
synced 2026-07-04 05:15:55 +08:00
chat template fix
This commit is contained in:
@@ -124,6 +124,7 @@ def main():
|
||||
# For ChatML we need to add special tokens and resize the embedding layer
|
||||
if "<|im_start|>" in tokenizer.chat_template and "gemma-tokenizer-chatml" not in tokenizer.name_or_path:
|
||||
model = AutoModelForCausalLM.from_pretrained(model_args.model_name_or_path, **model_kwargs)
|
||||
tokenizer.chat_template = None # Not quite sure why I have to do this, but if we end up with chatml for all models, and it's saved in the output tokeniser, that's fine
|
||||
model, tokenizer = setup_chat_format(model, tokenizer)
|
||||
model_kwargs = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user