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

[core] Fix import of randn_tensor #751

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Sep 11, 2023

Fixes huggingface/autotrain-advanced#259

With huggingface/diffusers#4829 being merged it changed a bit the structure of diffusers lib. the method randn_tensor which always lives inside diffusers.utils.torch_utils has been removed from diffusers.utils' init. Therefore causes import issues for users that are using the latest diffusers or in the next release. This PR fixes this

cc @kashif @vwxyzjn

@kashif
Copy link
Collaborator

kashif commented Sep 11, 2023

shall we also update the required diffusers version >= 0.21.0 which should be out in the next few days
`

@vwxyzjn
Copy link
Contributor

vwxyzjn commented Sep 11, 2023

LGTM. Let’s wait for tests to pass and merge.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 11, 2023

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

@younesbelkada
Copy link
Contributor Author

Thanks everyone!

shall we also update the required diffusers version >= 0.21.0 which should be out in the next few days

I think this is not strictly needed as that method always lived there since 0.18.0: https://github.com/huggingface/diffusers/blob/v0.18.0/src/diffusers/utils/torch_utils.py#L36

@younesbelkada younesbelkada merged commit 67452ef into main Sep 11, 2023
@younesbelkada younesbelkada deleted the fix-diffusers-import branch September 11, 2023 16:46
kushal-tri pushed a commit to kushalarora/trl that referenced this pull request Sep 19, 2023
@neo
Copy link

neo commented Oct 11, 2023

can we please do a release for this?

@younesbelkada
Copy link
Contributor Author

Yes @neo we will have a release soon

lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
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.

ImportError: cannot import name 'randn_tensor' from 'diffusers.utils'
5 participants