Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raytrun committed Nov 25, 2024
1 parent dcc5cdd commit e06b850
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llm2clip/eva_clip/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" CLIP Model
P""" CLIP Model
Adapted from https://github.com/openai/CLIP. Originally MIT License, Copyright (c) 2021 OpenAI.
"""
Expand All @@ -13,7 +13,7 @@
from torch import nn

try:
from .hf_model import HFTextEncoder
from .hf_model import HFTextEncoder
except:
HFTextEncoder = None
from .modified_resnet import ModifiedResNet
Expand Down Expand Up @@ -244,7 +244,7 @@ def set_grad_checkpointing(self, enable=True):

def forward(self, text, return_all_features: bool=False, l2_norm: bool=True):
if l2_norm:
x = torch.nn.functional.normalize(x, p=2, dim=-1)
x = torch.nn.functional.normalize(text, p=2, dim=-1)
x = self.text_adaptor(text)
return x

Expand Down

0 comments on commit e06b850

Please sign in to comment.