Skip to content

Commit

Permalink
Fix the logic that causes an issue with philschmid/gemma-tokenizer-ch…
Browse files Browse the repository at this point in the history
…atml tokenizer (#146)

The `setup_chat_format()` logic should not be applied to philschmid/gemma-tokenizer-chatml tokenizer, otherwise gemma models are trained w/o proper bos, eos tokens.
  • Loading branch information
kykim0 authored Apr 9, 2024
1 parent 8497cae commit a83b1f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/run_sft.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def main():

model = model_args.model_name_or_path
# For ChatML we need to add special tokens and resize the embedding layer
if "<|im_start|>" in tokenizer.chat_template:
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)
model, tokenizer = setup_chat_format(model, tokenizer)
model_kwargs = None
Expand Down

0 comments on commit a83b1f6

Please sign in to comment.