Skip to content

Commit e06b850

Browse files
committed
fix
1 parent dcc5cdd commit e06b850

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llm2clip/eva_clip/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" CLIP Model
1+
P""" CLIP Model
22
33
Adapted from https://github.com/openai/CLIP. Originally MIT License, Copyright (c) 2021 OpenAI.
44
"""
@@ -13,7 +13,7 @@
1313
from torch import nn
1414

1515
try:
16-
from .hf_model import HFTextEncoder
16+
from .hf_model import HFTextEncoder
1717
except:
1818
HFTextEncoder = None
1919
from .modified_resnet import ModifiedResNet
@@ -244,7 +244,7 @@ def set_grad_checkpointing(self, enable=True):
244244

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

0 commit comments

Comments
 (0)