huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
26.1k stars 5.38k forks source link

[BUG] 'GatheredParameters' object is not callable #9477

Closed LinB203 closed 3 weeks ago

LinB203 commented 1 month ago

Describe the bug

'GatheredParameters' object is not callable when we use zero3 in text-to-image.py

The context_manager has been initilized, why we need with context_manager(). I think it should be with context_manager. After replacing with context_manager() with with context_manager, the problem is solved.

https://github.com/huggingface/diffusers/commit/af2a237676ada656889de5e5b96ce609e37ed8c4#diff-5c07adf115dbb937f26dbfedff2aef0d31b4e8e3a58ba9cfb4a0c9f64672a8c5R213

Reproduction

when we use zero3 in text-to-image.py

Logs

No response

System Info

latest diffusers version

Who can help?

@yiyixuxu @DN6 @sayakpaul

sayakpaul commented 1 month ago

Thanks for investigating this! Do you want to submit a PR?

charchit7 commented 1 month ago

Hey @LinB203, thanks for identifying the issue. I've raised a PR on your behalf - I hope that's alright with you.