Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom token in train.py #246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Apr 26, 2023

  1. Fix custom token in train.py

    After the LLaMA model finetuning using the existing training code, I realized that the model never outputs the EOS token, which causes the generation never stop until max_new_token is reached.
    
    I tried to debug the code and found that `tokenizer.eos_token`, `tokenizer.bos_token`, and `tokenizer.unk_token` are all `'' (empty string).`
    
    Since `'' (empty string)` is not equal to `None`, the custom tokens in the training code will not be added. So I would  suggest fixing using the current code changes.
    
    I have tested that after the training using the modified code, the model can output EOS token correctly.
    naufalso authored Apr 26, 2023
    Configuration menu
    Copy the full SHA
    07241ed View commit details
    Browse the repository at this point in the history