raise error if layer cannot be loaded

Co-authored-by: Fabio Peruzzo <39661245+Xuzzo@users.noreply.github.com>
This commit is contained in:
Filip Strand 2024-09-04 19:43:32 +02:00 committed by GitHub
parent 0fd03c7552
commit b4c27a6fab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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']