Skip to content

Commit ae37da3

Browse files
fix: Update nomic ai model (#441)
* fix: Updated nomic ai with mean pooling * chore: Updated warning message * nit * fix: Fix ci
1 parent fa11d0f commit ae37da3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

fastembed/text/text_embedding.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from typing import Any, Iterable, Optional, Sequence, Type, Union
23

34
import numpy as np
@@ -62,6 +63,13 @@ def __init__(
6263
**kwargs,
6364
):
6465
super().__init__(model_name, cache_dir, threads, **kwargs)
66+
if model_name == "nomic-ai/nomic-embed-text-v1.5-Q":
67+
warnings.warn(
68+
"The model 'nomic-ai/nomic-embed-text-v1.5-Q' has been updated on HuggingFace. "
69+
"Please review the latest documentation and release notes to ensure compatibility with your workflow. ",
70+
UserWarning,
71+
stacklevel=2,
72+
)
6573
for EMBEDDING_MODEL_TYPE in self.EMBEDDINGS_REGISTRY:
6674
supported_models = EMBEDDING_MODEL_TYPE.list_supported_models()
6775
if any(model_name.lower() == model["model"].lower() for model in supported_models):

tests/test_text_onnx_embeddings.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23

34
import numpy as np
45
import pytest
@@ -48,7 +49,7 @@
4849
[-0.15407836, -0.03053198, -3.9138033, 0.1910364, 0.13224715]
4950
),
5051
"nomic-ai/nomic-embed-text-v1.5-Q": np.array(
51-
[-0.12525563, 0.38030425, -3.961622, 0.04176439, -0.0758301]
52+
[0.0802303, 0.3700881, -4.3053818, 0.4431803, -0.271572]
5253
),
5354
"thenlper/gte-large": np.array(
5455
[-0.01920587, 0.00113156, -0.00708992, -0.00632304, -0.04025577]
@@ -71,9 +72,12 @@
7172

7273
def test_embedding():
7374
is_ci = os.getenv("CI")
75+
is_mac = platform.system() == "Darwin"
7476

7577
for model_desc in TextEmbedding.list_supported_models():
76-
if not is_ci and model_desc["size_in_GB"] > 1:
78+
if (not is_ci and model_desc["size_in_GB"] > 1) or (
79+
is_mac and model_desc["model"] == "nomic-ai/nomic-embed-text-v1.5-Q"
80+
):
7781
continue
7882

7983
dim = model_desc["dim"]

0 commit comments

Comments
 (0)