Skip to content

[LoRA training] add aspect ratio bucketing #11438

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

linoytsaban
Copy link
Collaborator

@linoytsaban linoytsaban commented Apr 28, 2025

support multi-aspect training

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@linoytsaban linoytsaban marked this pull request as ready for review April 30, 2025 09:02
@linoytsaban linoytsaban requested a review from sayakpaul May 2, 2025 08:45
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Very nice effort. WDYT about making methods like parse_buckets_string(), find_nearest_bucket() a part of training_utils.py?

@linoytsaban
Copy link
Collaborator Author

@bot /style

Copy link
Contributor

github-actions bot commented May 2, 2025

Style fixes have been applied. View the workflow run here.

repeats=args.repeats,
center_crop=args.center_crop,
)

batch_sampler = BucketBatchSampler(train_dataset, batch_size=args.train_batch_size, drop_last=False)
Copy link
Member

Choose a reason for hiding this comment

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

just curious, why is the drop_last not True here? in this other PR this is set to True so it doesn't error when the batch size is > 1 and the last batch does not have enough images.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thank for pointing it out! replied in #11921

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.

4 participants