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

Question about ignoration of <|endoftext|> #18

Open
lxysl opened this issue May 8, 2024 · 0 comments
Open

Question about ignoration of <|endoftext|> #18

lxysl opened this issue May 8, 2024 · 0 comments

Comments

@lxysl
Copy link

lxysl commented May 8, 2024

Thanks for your nice work. I have a question about whether to predict the <STOP> token. As seen in the original LLaVA paper, they predict these stop tokens:
image
and their preprocess codes are:
https://github.com/haotian-liu/LLaVA/blob/3e337ad269da3245643a2724a1d694b5839c37f9/llava/train/train.py#L470-L481
but your codes are, which seem not to predict these stop tokens:

if has_image:
round_len = len(tokenizer_image_token(rou, tokenizer)) + 1 # +1 for <|endoftext|>
instruction_len = len(tokenizer_image_token(parts[0], tokenizer)) - 1
else:
round_len = len(tokenizer(rou).input_ids) + 1 # +1 for <|endoftext|>
instruction_len = len(tokenizer(parts[0]).input_ids) - 1
target[cur_len: cur_len + instruction_len] = IGNORE_INDEX

Could you please give some explanations or insights into these differences?

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