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

[SD3 Inference] T5 Token limit #8506

Merged
merged 7 commits into from
Jun 18, 2024
Merged

Conversation

asomoza
Copy link
Member

@asomoza asomoza commented Jun 13, 2024

What does this PR do?

Adds an argument max_sequence_length to set the token limit for the T5.

Prompt:

A whimsical and creative image depicting a hybrid creature that is a mix of a waffle and a hippopotamus. This imaginative creature features the distinctive, bulky body of a hippo, but with a texture and appearance resembling a golden-brown, crispy waffle. The creature might have elements like waffle squares across its skin and a syrup-like sheen. It’s set in a surreal environment that playfully combines a natural water habitat of a hippo with elements of a breakfast table setting, possibly including oversized utensils or plates in the background. The image should evoke a sense of playful absurdity and culinary fantasy.

Before max_sequence_length=256
20240612204503_2888268196 20240612204440_2888268196

I did a quick test with enabling long prompts for the clip models but it didn't make any noticeable difference, so for now this PR will only enable the long prompt for the T5 to avoid adding more code and complexity to the pipeline.

Who can review?

Anyone in the community is free to review

@asomoza asomoza changed the title max_sequence_length for the T5 T5 Token limit Jun 13, 2024
@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.

@yiyixuxu yiyixuxu mentioned this pull request Jun 13, 2024
@asomoza
Copy link
Member Author

asomoza commented Jun 14, 2024

the failing test is not from this PR

@asomoza asomoza marked this pull request as ready for review June 14, 2024 00:13
@asomoza asomoza requested review from yiyixuxu and sayakpaul June 14, 2024 00:14
Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!

@asomoza asomoza changed the title T5 Token limit [SD3 Inference] T5 Token limit Jun 14, 2024
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.

Thanks for the prompt PR. I left some questions. Overall this looks good to me. My only concern is that we're introducing a change that might lead to different results for the same prompt.

@yiyixuxu yiyixuxu merged commit f3209b5 into huggingface:main Jun 18, 2024
14 of 15 checks passed
@yiyixuxu
Copy link
Collaborator

@asomoza can we add a section to the doc (in a new PR)?

@asomoza asomoza deleted the token-max-length branch June 18, 2024 16:58
yiyixuxu added a commit that referenced this pull request Jun 20, 2024
* max_sequence_length for the T5

* updated img2img

* apply suggestions

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* max_sequence_length for the T5

* updated img2img

* apply suggestions

---------

Co-authored-by: Sayak Paul <[email protected]>
Co-authored-by: YiYi Xu <[email protected]>
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.

5 participants