support specifying te and unet weights separately

update lora code
support full module
This commit is contained in:
AUTOMATIC1111
2023-07-17 09:00:47 +03:00
parent 46466f09d0
commit 238adeaffb
10 changed files with 151 additions and 78 deletions

View File

@@ -13,3 +13,9 @@ def rebuild_conventional(up, down, shape, dyn_dim=None):
up = up[:, :dyn_dim]
down = down[:dyn_dim, :]
return (up @ down).reshape(shape)
def rebuild_cp_decomposition(up, down, mid):
up = up.reshape(up.size(0), -1)
down = down.reshape(down.size(0), -1)
return torch.einsum('n m k l, i n, m j -> i j k l', mid, up, down)