Skip to content

Commit 7c80254

Browse files
authored
diffusers docker image: LoRA loading fixes (#380)
* diffusers docker image: load lora uncaught errors broader exception type catch on fuse_lora this fixes the follwing bug: when some error was encountered in _fuse_or_raise the lora adapter the exception was not always caught, as a consequence the lora adapter was not unloaded. Any subsequent call to the same adapter actually performed inference from the base model, as long as no new adapter was loaded * diffusers image: upgrade peft dependency Fixes some LoRA adapters loading issues with peft backend See huggingface/diffusers#6809
1 parent e74c506 commit 7c80254

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docker_images/diffusers/app/lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _is_pivotal_tuning_lora(model_data):
6262
def _fuse_or_raise(self):
6363
try:
6464
self.ldm.fuse_lora(safe_fusing=True)
65-
except ValueError as e:
65+
except Exception as e:
6666
logger.exception(e)
6767
logger.warning("Unable to fuse LoRA adapter")
6868
self.ldm.unload_lora_weights()

docker_images/diffusers/requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ uvicorn>=0.23.2
1717
gunicorn>=21.2.0
1818
psutil>=5.9.5
1919
aiohttp>=3.8.5
20-
peft==0.7.1
20+
# Tmp: replace with version once there is a tag above 0.8.1
21+
# This commit includes a fix that concerns
22+
# https://github.com/huggingface/diffusers/issues/6809
23+
# peft==0.7.1
24+
git+https://github.com/huggingface/peft.git@a30e006bb2f82824ab24435b9f07932738b44966

0 commit comments

Comments
 (0)