1
0
Fork 0

fix(api): correctly handle sliced kernels

This commit is contained in:
Sean Sube 2023-06-17 14:51:58 -05:00
parent 1506f51ff4
commit 7db53a82df
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 8 deletions

View File

@ -288,14 +288,9 @@ def blend_loras(
down_w, down_h = kernel_slice(w, h, down_weight.shape)
up_w, up_h = kernel_slice(w, h, up_weight.shape)
weights[:, :, w, h] = up_weight[
:, :, up_w, up_h
].squeeze(3).squeeze(2) @ down_weight[
:, :, down_w, down_h
].squeeze(
3
).squeeze(
2
weights[:, :, w, h] = (
up_weight[:, :, up_w, up_h]
@ down_weight[:, :, down_w, down_h]
)
np_weights = weights.numpy() * (alpha / dim)