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

Zero dropped captions #77

Merged
merged 3 commits into from
Oct 13, 2023
Merged

Conversation

jazcollins
Copy link
Contributor

Previously when we applied caption dropout (via caption_drop_prob in the dataloader), those dropped captions (i.e. empty strings) would end up getting tokenized into padding tokens and encoded by the text encoder(s). This PR adds the option to instead encode the dropped captions as an all zeros tensor by setting zero_dropped_caption=True. Currently this flag is set such that zero-ing out dropped captions will become the new default behavior for both SD2 and SDXL training.

Copy link
Collaborator

@coryMosaicML coryMosaicML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Contributor

@Landanjs Landanjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

diffusion/datasets/image_caption.py Outdated Show resolved Hide resolved
@jazcollins jazcollins merged commit 767db4f into mosaicml:main Oct 13, 2023
7 checks passed
@jazcollins jazcollins deleted the zero-dropped-captions branch October 13, 2023 16:43
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

Successfully merging this pull request may close these issues.

3 participants