Skip to content

[LoRA] fix: disabling hooks when loading loras. #11896

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

Merged
merged 4 commits into from
Jul 10, 2025
Merged

Conversation

sayakpaul
Copy link
Member

What does this PR do?

Fixes huggingface/accelerate#3672

from diffusers import AutoPipelineForText2Image, DiffusionPipeline
import torch

pipe = DiffusionPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()
pipe.load_lora_weights(
    "renderartist/retrocomicflux", 
    weight_name="Retro_Comic_Flux_v1_renderartist.safetensors", 
    adapter_name="test"
)

Fails with:

AttributeError: 'NoneType' object has no attribute '__dict__'. Did you mean: '__dir__'?

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!

@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.

Copy link
Member

@a-r-r-o-w a-r-r-o-w left a comment

Choose a reason for hiding this comment

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

Thanks!

@sayakpaul sayakpaul merged commit 265840a into main Jul 10, 2025
32 checks passed
@sayakpaul sayakpaul deleted the fix-disabling-hooks branch July 10, 2025 05:00
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.

a bug in remove_hook_from_module
4 participants