From 0be0cfb6efbba02e5fc3fd0fe335e728b52d96f9 Mon Sep 17 00:00:00 2001 From: Rei Koshka Date: Wed, 8 May 2024 02:06:38 +0300 Subject: [PATCH] GH-3 Try to fix prompts difference failure Removes some code which causes failure. Removing doesn't ruin simple workflow at this point. --- attention_couple.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/attention_couple.py b/attention_couple.py index af3067d..8f95ae6 100644 --- a/attention_couple.py +++ b/attention_couple.py @@ -116,8 +116,8 @@ class AttentionCouple: masks_uncond = get_masks_from_q(self.negative_positive_masks[0], q_list[0], extra_options["original_shape"]) masks_cond = get_masks_from_q(self.negative_positive_masks[1], q_list[0], extra_options["original_shape"]) - context_uncond = torch.cat([cond for cond in self.negative_positive_conds[0]], dim=0) - context_cond = torch.cat([cond for cond in self.negative_positive_conds[1]], dim=0) + context_uncond = self.negative_positive_conds[0][0] + context_cond = self.negative_positive_conds[1][0] k_uncond = module.to_k(context_uncond) k_cond = module.to_k(context_cond) @@ -138,8 +138,6 @@ class AttentionCouple: length = len_neg q_target = q_list[i].repeat(length, 1, 1) - k = torch.cat([k[i].unsqueeze(0).repeat(b,1,1) for i in range(length)], dim=0) - v = torch.cat([v[i].unsqueeze(0).repeat(b,1,1) for i in range(length)], dim=0) qkv = optimized_attention(q_target, k, v, extra_options["n_heads"]) qkv = qkv * masks