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

Inf Loss Problem When Training #30

Closed
nreHieW opened this issue Jul 19, 2024 · 1 comment
Closed

Inf Loss Problem When Training #30

nreHieW opened this issue Jul 19, 2024 · 1 comment

Comments

@nreHieW
Copy link

nreHieW commented Jul 19, 2024

In line 1628-1629 of transformers/src/transformers/models/chameleon/modeling_chameleon.py

image_tokens = self.model.vocabulary_mapping.image_tokens
logits[:, :, image_tokens] = torch.finfo(logits.dtype).min

My understanding is that this is here because the original Chameleon intentionally did not want to generate any image tokens. But keeping this in for training would lead to inf loss.

Is there an updated version of the code?

@nreHieW nreHieW closed this as completed Jul 19, 2024
@leloykun
Copy link

Hi! You can either use the version in the transformers folder or this PR of mine to the main Transformers library: huggingface/transformers#32013

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