-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this 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?
Co-authored-by: Younes Belkada <49240599+younesbelkada@users.noreply.github.com>
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @osanseviero !
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 |
trl/models/modeling_sd_base.py
Outdated
if is_diffusers_greater_than("0.20.2"): | ||
from diffusers.utils.torch_utils import randn_tensor | ||
else: | ||
from diffusers.utils import randn_tensor |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense yeah !
trl/torch_utils.py
Outdated
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops will remove it
There was a problem hiding this 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.
* 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>
No description provided.