From 158c7867e724201308cfd03f3cdc5bdc78d09493 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 27 Aug 2023 15:35:59 +0200 Subject: [PATCH] fix(diffusers): correctly check alpha (#967) **Description** Loras that have no alpha would crash otherwise Signed-off-by: Ettore Di Giacinto --- extra/grpc/diffusers/backend_diffusers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/grpc/diffusers/backend_diffusers.py b/extra/grpc/diffusers/backend_diffusers.py index 8f8e2b5c6e34..cff461f8bde0 100755 --- a/extra/grpc/diffusers/backend_diffusers.py +++ b/extra/grpc/diffusers/backend_diffusers.py @@ -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: