From bd4e825b8b54aaa2a46449c15846e5aa6c272c96 Mon Sep 17 00:00:00 2001 From: BVH <82035780+bvhari@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:46:58 +0530 Subject: [PATCH] Bug fix --- clipperpweight.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clipperpweight.py b/clipperpweight.py index b76b2f1..45f24b9 100644 --- a/clipperpweight.py +++ b/clipperpweight.py @@ -25,7 +25,7 @@ class CLIPTextEncodePerpWeight: weight = tokens[i][j][1] if weight != 1.0: token_vector = unweighted_cond[i][j] - zero_vector = empty_cond[i][j] + zero_vector = empty_cond[0][j] perp = ((torch.mul(zero_vector, token_vector).sum())/(torch.norm(token_vector)**2)) * token_vector cond[i][j] = token_vector + (weight * perp)