From 628a7923a389e7604c30b6529a268259e1d21684 Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Sat, 12 Oct 2024 00:43:18 +0000 Subject: [PATCH] Remove norm on image embeds on custom adapter --- toolkit/custom_adapter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/custom_adapter.py b/toolkit/custom_adapter.py index 9fae4090..28fdd78a 100644 --- a/toolkit/custom_adapter.py +++ b/toolkit/custom_adapter.py @@ -884,8 +884,8 @@ class CustomAdapter(torch.nn.Module): clip_image_embeds = clip_output.pooler_output # TODO should we always norm image embeds? # get norm embeddings - l2_norm = torch.norm(clip_image_embeds, p=2) - clip_image_embeds = clip_image_embeds / l2_norm + # l2_norm = torch.norm(clip_image_embeds, p=2) + # clip_image_embeds = clip_image_embeds / l2_norm if not is_training or not self.config.train_image_encoder: clip_image_embeds = clip_image_embeds.detach()