huggingface / huggingface/diffusers

Lora does not support module_to_save()

Open
#9,810 2 comments 0 reactions 0 assignees View on GitHub
bug stale
Dominant language
Python
Stars
34.5k
Forks
7.3k
Avg merge
3d 3h
Merged PRs (30d)
91

Description

### Describe the bug

When we set
```
LoraConfig(
r=args.rank,
lora_alpha=args.lora_alpha,
init_lora_weights=True,
target_modules=["to_k", "to_q", "to_v", "to_out.0"],
modules_to_save=["other"],
)
```
if `modules_to_save` is not none, then we load the adapter,`diffusers/src/diffusers/loaders/lora_pipeline.py` line 2681 `is_correct_format = all("lora" in key for key in state_dict.keys())` will be `False`

### Reproduction

See Descrination

### Logs

_No response_

### System Info

diffusers 0.32.0

### Who can help?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.