Update modeling_jina_embeddings_v4.py
Browse files
modeling_jina_embeddings_v4.py
CHANGED
@@ -346,6 +346,7 @@ class JinaEmbeddingsV4Model(Qwen2_5_VLForConditionalGeneration):
|
|
346 |
embeddings = embeddings.single_vec_emb
|
347 |
if truncate_dim is not None:
|
348 |
embeddings = embeddings[:, :truncate_dim]
|
|
|
349 |
else:
|
350 |
embeddings = embeddings.multi_vec_emb
|
351 |
|
|
|
346 |
embeddings = embeddings.single_vec_emb
|
347 |
if truncate_dim is not None:
|
348 |
embeddings = embeddings[:, :truncate_dim]
|
349 |
+
embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=-1)
|
350 |
else:
|
351 |
embeddings = embeddings.multi_vec_emb
|
352 |
|