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

resize embedding after add_special_tokens #56

Open
Switchsyj opened this issue Sep 3, 2024 · 0 comments
Open

resize embedding after add_special_tokens #56

Switchsyj opened this issue Sep 3, 2024 · 0 comments

Comments

@Switchsyj
Copy link

Hi, thanks for your great work! I would like to point out a potential bug in this code:
add_special_tokens without checking embedding size is very dangerous especially for llama. In fact, llama use <end_of_text> as eos and bos token during training. Otherwise, you need to resize the embedding after add_special_tokens '' or it would out of bounds while torch.gather.

Code line:

RRHF/train.py

Line 302 in e1a2b61

if "llama" in model_args.model_name_or_path:

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

1 participant