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

Support both old and new diffusers import path #843

Merged
merged 7 commits into from
Oct 12, 2023

Conversation

osanseviero
Copy link
Contributor

No description provided.

@osanseviero osanseviero marked this pull request as draft October 7, 2023 20:51
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 7, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks ! I left a single comment, WDYT?

trl/models/modeling_sd_base.py Outdated Show resolved Hide resolved
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks! can you run the styling checks?

make precommit

@younesbelkada younesbelkada marked this pull request as ready for review October 11, 2023 16:36
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thank you @osanseviero !

@younesbelkada
Copy link
Contributor

Note the lazy import has been added in 0.21.0 and the latest version before that is 0.20.2

https://github.com/huggingface/diffusers/releases/tag/v0.21.0

Comment on lines 31 to 34
if is_diffusers_greater_than("0.20.2"):
from diffusers.utils.torch_utils import randn_tensor
else:
from diffusers.utils import randn_tensor
Copy link
Member

Choose a reason for hiding this comment

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

If I understood Patrick correctly, randn_tensor is an internal method that could be deprecated, delete, renamed at any time. Should we not use it and instead add our own?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense yeah !

@younesbelkada younesbelkada requested a review from lvwerra October 12, 2023 12:46
Copy link
Member

Choose a reason for hiding this comment

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

Why is there an empty file? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

oops will remove it

Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Just that question about the empty file.

@younesbelkada younesbelkada merged commit 96d4854 into huggingface:main Oct 12, 2023
11 checks passed
lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
* Update modeling_sd_base.py

* Update trl/models/modeling_sd_base.py

Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>

* make precommit

* cleaner approach

* oops

* better alternative

* rm uneeded file

---------

Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
Co-authored-by: younesbelkada <younesbelkada@gmail.com>
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