Commit
·
ed1da94
1
Parent(s):
626832e
fix: truncate embeddings
Browse files- modeling_clip.py +2 -2
modeling_clip.py
CHANGED
@@ -408,7 +408,7 @@ class JinaCLIPModel(JinaCLIPPreTrainedModel):
|
|
408 |
embeddings = self.get_image_features(pixelvals)
|
409 |
|
410 |
if truncate_dim:
|
411 |
-
embeddings = self.
|
412 |
if normalize_embeddings:
|
413 |
embeddings = f.normalize(embeddings, p=2, dim=1)
|
414 |
if convert_to_numpy:
|
@@ -537,7 +537,7 @@ class JinaCLIPModel(JinaCLIPPreTrainedModel):
|
|
537 |
).to(self.device)
|
538 |
embeddings = self.get_text_features(input_ids=tokens)
|
539 |
if truncate_dim:
|
540 |
-
embeddings = self.
|
541 |
if normalize_embeddings:
|
542 |
embeddings = f.normalize(embeddings, p=2, dim=1)
|
543 |
if convert_to_numpy:
|
|
|
408 |
embeddings = self.get_image_features(pixelvals)
|
409 |
|
410 |
if truncate_dim:
|
411 |
+
embeddings = self._truncate_embeddings(embeddings, truncate_dim)
|
412 |
if normalize_embeddings:
|
413 |
embeddings = f.normalize(embeddings, p=2, dim=1)
|
414 |
if convert_to_numpy:
|
|
|
537 |
).to(self.device)
|
538 |
embeddings = self.get_text_features(input_ids=tokens)
|
539 |
if truncate_dim:
|
540 |
+
embeddings = self._truncate_embeddings(embeddings, truncate_dim)
|
541 |
if normalize_embeddings:
|
542 |
embeddings = f.normalize(embeddings, p=2, dim=1)
|
543 |
if convert_to_numpy:
|