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

EOS token '\n' not working properly in llama3 #72

Open
sjaelee25 opened this issue May 22, 2024 · 1 comment
Open

EOS token '\n' not working properly in llama3 #72

sjaelee25 opened this issue May 22, 2024 · 1 comment

Comments

@sjaelee25
Copy link

There is an issue with '\n' not working properly in llama3. When passing '\n' through tokenizer.encode, it outputs the token ID 198, but it does not terminate the sentence generation appropriately and continues generating subsequent text.
eos_token_id = base_model.tokenizer.encode("\n", bos=False, eos=False)[-1]
In contrast, using other strings like 'Q' works correctly. Additionally, testing with llama2 shows that all strings, including '\n', work as expected.

Could you please look into this issue?

@Ber666
Copy link
Collaborator

Ber666 commented May 22, 2024

Yes, there is a slight difference in tokenization with Llama-3 compared to other models, e.g., \n\n is a different token from \n. To use llama-3, maybe you want to play with the tokenizer and investigate what's the really desired eos_token in your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants