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

Confusion Regarding Label Generation Process #153

Open
Asunatan opened this issue Mar 12, 2025 · 0 comments
Open

Confusion Regarding Label Generation Process #153

Asunatan opened this issue Mar 12, 2025 · 0 comments

Comments

@Asunatan
Copy link

Hello, I'm a beginner in the field of VLM and I'm confused about label generation.
In the sft.py:

  labels = batch["input_ids"].clone()
  labels[labels == processor.tokenizer.pad_token_id] = -100
  image_token_id = processor.tokenizer.convert_tokens_to_ids(processor.image_token)
  labels[labels == image_token_id] = -100
  batch["labels"] = labels

This means that, except for pad_token_id and image_token, all other tokens will be used to calculate the loss, including the system prompt, <|im_start|>user\n, etc. I noticed that in LLaVA-CoT, labels are generated by searching for each token individually, and tokens like <|im_start|>assistant\n are masked. I'm curious whether only masking pad_token_id and image_token could lead to some unexpected errors?

Image

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