Closed Eun0 closed 1 year ago
Does it work when peft is not installed?
@sayakpaul
Yes, I got this error when updating diffusers and peft
Can you check if the error goes away when peft is not installed? Maybe in a fresh environment?
Cc: @younesbelkada
@sayakpaul Cc: @younesbelkada
I create new conda env with
# requirements.txt
opencv-python
transformers
accelerate
xformers
git+https://github.com/huggingface/diffusers
It works
Thanks for reporting and for the reproducer ! Will have a look
Hi @Eun0 https://github.com/huggingface/diffusers/pull/5608 should fix your issue!
Hi @Eun0 #5608 should fix your issue!
Thank you!!
Describe the bug
I got an error message when loading LoRA in civitai using
pipeline.load_lora_weights()
where,
The LoRA model is safetensors format with no alpha value In
get_peft_kwargs
, it assumes the default value ofnetwork_alpha_dict
isNone
but actual default value is empty dictionary{}
aftercls._convert_kohya_lora_to_diffusers()
inLoraLoaderMixin.lora_state_dict()
I think there are three ways to fix this bug
if
statement inget_peft_kwargs
to check empty dictionary.LoraLoaderMixin.lora_state_dict
network_alphas
->network_alphas_dict
and default value as empty dictionryBut, this way requires changing all if statements that use
network_alphas
parametersReproduction
Download ahri LoRA in (https://civitai.com/models/4789/ahri-league-of-legends-lora)
Logs
System Info
diffusers
version: 0.22.0.dev0Who can help?
@sayakpaul @patrickvonplaten