From b4c27a6faba6496cc3caf0fcfc975a5478ea675e Mon Sep 17 00:00:00 2001 From: Filip Strand Date: Wed, 4 Sep 2024 19:43:32 +0200 Subject: [PATCH] raise error if layer cannot be loaded Co-authored-by: Fabio Peruzzo <39661245+Xuzzo@users.noreply.github.com> --- src/flux_1/weights/weight_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flux_1/weights/weight_handler.py b/src/flux_1/weights/weight_handler.py index 0369558..024228a 100644 --- a/src/flux_1/weights/weight_handler.py +++ b/src/flux_1/weights/weight_handler.py @@ -86,7 +86,7 @@ class WeightHandler: visited[parentKey]={} visited[parentKey][splitKey]=weight if not 'weight' in target: - continue + raise ValueError(f"LoRA weights for layer {parentKey} cannot be loaded into the model.") if 'lora_A' in visited[parentKey] and 'lora_B' in visited[parentKey]: lora_a=visited[parentKey]['lora_A'] lora_b=visited[parentKey]['lora_B']