Skip to content

Commit

Permalink
fix(diffusers): correctly check alpha (#967)
Browse files Browse the repository at this point in the history
**Description**

Loras that have no alpha would crash otherwise

Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Aug 27, 2023
1 parent 997c39c commit 158c786
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra/grpc/diffusers/backend_diffusers.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def load_lora_weights(self, checkpoint_path, multiplier, device, dtype):
# get elements for this layer
weight_up = elems['lora_up.weight'].to(dtype)
weight_down = elems['lora_down.weight'].to(dtype)
alpha = elems['alpha']
alpha = elems['alpha'] if 'alpha' in elems else None
if alpha:
alpha = alpha.item() / weight_up.shape[1]
else:
Expand Down

0 comments on commit 158c786

Please sign in to comment.