mteb 2.7.19__py3-none-any.whl → 2.7.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ from packaging.specifiers import SpecifierSet
7
7
  from torch.utils.data import DataLoader
8
8
  from transformers import __version__ as transformers_version
9
9
 
10
+ from mteb._requires_package import requires_package
10
11
  from mteb.models.abs_encoder import AbsEncoder
11
12
  from mteb.models.model_meta import ModelMeta
12
13
 
@@ -24,27 +25,51 @@ LLAMA_NEMORETRIEVER_CITATION = """@misc{xu2025llamanemoretrievercolembedtopperfo
24
25
  url={https://arxiv.org/abs/2507.05513}
25
26
  }"""
26
27
 
28
+ # Transformers version constraints per extra.
29
+ # Keep in sync with pyproject.toml [project.optional-dependencies]
30
+ #
31
+ # Note: The extra name reflects the transformers version requirement, not the model version.
32
+ # For example, llama-nemotron-colembed-vl-3b-v2 uses "llama-nemotron-colembed-vl" because it
33
+ # requires transformers==4.49.0, even though it's a "v2" model by name.
34
+ _TRANSFORMERS_CONSTRAINTS: dict[str, str] = {
35
+ "llama-nemotron-colembed-vl": "==4.49.0", # llama-nemoretriever-colembed-*
36
+ "nemotron-colembed-vl-v2": "==5.0.0rc0", # nemotron-colembed-vl-4b-v2, nemotron-colembed-vl-8b-v2
37
+ }
38
+
39
+
40
+ class NemotronColEmbedVL(AbsEncoder):
41
+ """Encoder for the NemotronColEmbedVL family of models."""
27
42
 
28
- class LlamaNemoretrieverColembed(AbsEncoder):
29
43
  def __init__(
30
44
  self,
31
45
  model_name_or_path: str,
32
46
  revision: str,
33
47
  trust_remote_code: bool,
34
- transformers_version_constraint: str | None = None,
48
+ extra_name: str = "llama-nemotron-colembed-vl",
35
49
  device_map="cuda",
36
50
  torch_dtype=torch.bfloat16,
37
51
  attn_implementation="flash_attention_2",
38
52
  **kwargs,
39
53
  ):
40
- if transformers_version_constraint is not None:
41
- spec = SpecifierSet(transformers_version_constraint)
42
- if transformers_version not in spec:
43
- raise RuntimeError(
44
- f"Model `{model_name_or_path}` requires transformers{transformers_version_constraint}, "
45
- f"but {transformers_version} is installed. "
46
- f"Run: pip install 'transformers{transformers_version_constraint}'"
47
- )
54
+ install_hint = f"pip install 'mteb[{extra_name}]'"
55
+
56
+ # Check transformers version
57
+ constraint = _TRANSFORMERS_CONSTRAINTS.get(extra_name)
58
+ if constraint is None:
59
+ raise ValueError(
60
+ f"Unknown extra_name '{extra_name}'. "
61
+ f"Must be one of: {list(_TRANSFORMERS_CONSTRAINTS.keys())}"
62
+ )
63
+ if transformers_version not in SpecifierSet(constraint):
64
+ raise RuntimeError(
65
+ f"Model `{model_name_or_path}` requires transformers{constraint}, "
66
+ f"but {transformers_version} is installed. "
67
+ f"Run: {install_hint}"
68
+ )
69
+
70
+ # Check required packages
71
+ for package in ("torchvision", "accelerate", "flash_attn"):
72
+ requires_package(self, package, model_name_or_path, install_hint)
48
73
 
49
74
  from transformers import AutoModel
50
75
 
@@ -166,10 +191,10 @@ TRAINING_DATA_v2 = {
166
191
  }
167
192
 
168
193
  llama_nemoretriever_colembed_1b_v1 = ModelMeta(
169
- loader=LlamaNemoretrieverColembed,
194
+ loader=NemotronColEmbedVL,
170
195
  loader_kwargs=dict(
196
+ extra_name="llama-nemotron-colembed-vl",
171
197
  trust_remote_code=True,
172
- transformers_version_constraint="==4.49.0",
173
198
  ),
174
199
  name="nvidia/llama-nemoretriever-colembed-1b-v1",
175
200
  model_type=["late-interaction"],
@@ -195,10 +220,10 @@ llama_nemoretriever_colembed_1b_v1 = ModelMeta(
195
220
  )
196
221
 
197
222
  llama_nemoretriever_colembed_3b_v1 = ModelMeta(
198
- loader=LlamaNemoretrieverColembed,
223
+ loader=NemotronColEmbedVL,
199
224
  loader_kwargs=dict(
225
+ extra_name="llama-nemotron-colembed-vl",
200
226
  trust_remote_code=True,
201
- transformers_version_constraint="==4.49.0",
202
227
  ),
203
228
  name="nvidia/llama-nemoretriever-colembed-3b-v1",
204
229
  model_type=["late-interaction"],
@@ -224,10 +249,10 @@ llama_nemoretriever_colembed_3b_v1 = ModelMeta(
224
249
  )
225
250
 
226
251
  llama_nemotron_colembed_vl_3b_v2 = ModelMeta(
227
- loader=LlamaNemoretrieverColembed,
252
+ loader=NemotronColEmbedVL,
228
253
  loader_kwargs=dict(
254
+ extra_name="llama-nemotron-colembed-vl",
229
255
  trust_remote_code=True,
230
- transformers_version_constraint="==4.49.0",
231
256
  ),
232
257
  name="nvidia/llama-nemotron-colembed-vl-3b-v2",
233
258
  model_type=["late-interaction"],
@@ -251,11 +276,12 @@ llama_nemotron_colembed_vl_3b_v2 = ModelMeta(
251
276
  citation=LLAMA_NEMORETRIEVER_CITATION,
252
277
  )
253
278
 
279
+
254
280
  nemotron_colembed_vl_4b_v2 = ModelMeta(
255
- loader=LlamaNemoretrieverColembed,
281
+ loader=NemotronColEmbedVL,
256
282
  loader_kwargs=dict(
283
+ extra_name="nemotron-colembed-vl-v2",
257
284
  trust_remote_code=True,
258
- transformers_version_constraint="==5.0.0rc0",
259
285
  ),
260
286
  name="nvidia/nemotron-colembed-vl-4b-v2",
261
287
  revision="823b1625c15fe3da73fa094205e538a7a2301a2a",
@@ -280,10 +306,10 @@ nemotron_colembed_vl_4b_v2 = ModelMeta(
280
306
 
281
307
 
282
308
  nemotron_colembed_vl_8b_v2 = ModelMeta(
283
- loader=LlamaNemoretrieverColembed,
309
+ loader=NemotronColEmbedVL,
284
310
  loader_kwargs=dict(
311
+ extra_name="nemotron-colembed-vl-v2",
285
312
  trust_remote_code=True,
286
- transformers_version_constraint="==5.0.0rc0",
287
313
  ),
288
314
  name="nvidia/nemotron-colembed-vl-8b-v2",
289
315
  revision="6cbe43579dda6237768fc373768ad372cc5cdfec",
@@ -26,6 +26,7 @@ class OpsColQwen3Wrapper(AbsEncoder):
26
26
  revision: str | None = None,
27
27
  device: str | None = None,
28
28
  attn_implementation: str | None = None,
29
+ trust_remote_code: bool = True,
29
30
  **kwargs,
30
31
  ):
31
32
  requires_image_dependencies()
@@ -42,15 +43,15 @@ class OpsColQwen3Wrapper(AbsEncoder):
42
43
  model_name,
43
44
  device_map=self.device,
44
45
  attn_implementation=attn_implementation,
45
- trust_remote_code=True,
46
46
  revision=revision,
47
+ trust_remote_code=trust_remote_code,
47
48
  **kwargs,
48
49
  )
49
50
  self.mdl.eval()
50
51
 
51
52
  self.processor = AutoProcessor.from_pretrained(
52
53
  model_name,
53
- trust_remote_code=True,
54
+ trust_remote_code=trust_remote_code,
54
55
  )
55
56
 
56
57
  def encode(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mteb
3
- Version: 2.7.19
3
+ Version: 2.7.21
4
4
  Summary: Massive Text Embedding Benchmark
5
5
  Author-email: MTEB Contributors <niklas@huggingface.co>, Kenneth Enevoldsen <kenneth.enevoldsen@cas.au.dk>, Nouamane Tazi <nouamane@huggingface.co>, Nils Reimers <info@nils-reimers.de>
6
6
  Maintainer-email: Kenneth Enevoldsen <kenneth.enevoldsen@cas.au.dk>, Roman Solomatin <risolomatin@gmail.com>, Isaac Chung <chungisaac1217@gmail.com>
@@ -104,6 +104,16 @@ Requires-Dist: tencentcloud-sdk-python-common>=3.0.1454; extra == "youtu"
104
104
  Requires-Dist: tencentcloud-sdk-python-lkeap>=3.0.1451; extra == "youtu"
105
105
  Provides-Extra: llama-embed-nemotron
106
106
  Requires-Dist: transformers==4.51.0; extra == "llama-embed-nemotron"
107
+ Provides-Extra: llama-nemotron-colembed-vl
108
+ Requires-Dist: transformers[torch]==4.49.0; extra == "llama-nemotron-colembed-vl"
109
+ Requires-Dist: torchvision>=0.22.0; extra == "llama-nemotron-colembed-vl"
110
+ Requires-Dist: flash-attn>=2.6.3; extra == "llama-nemotron-colembed-vl"
111
+ Requires-Dist: accelerate; extra == "llama-nemotron-colembed-vl"
112
+ Provides-Extra: nemotron-colembed-vl-v2
113
+ Requires-Dist: transformers[torch]==5.0.0rc0; extra == "nemotron-colembed-vl-v2"
114
+ Requires-Dist: torchvision>=0.22.0; extra == "nemotron-colembed-vl-v2"
115
+ Requires-Dist: flash-attn>=2.6.3; extra == "nemotron-colembed-vl-v2"
116
+ Requires-Dist: accelerate; extra == "nemotron-colembed-vl-v2"
107
117
  Provides-Extra: faiss-cpu
108
118
  Requires-Dist: faiss-cpu>=1.12.0; extra == "faiss-cpu"
109
119
  Provides-Extra: eager-embed
@@ -1568,13 +1568,13 @@ mteb/models/model_implementations/nbailab.py,sha256=iv2xdqVM5HoTAlBR6e_UdzJu6rSP
1568
1568
  mteb/models/model_implementations/no_instruct_sentence_models.py,sha256=DTb-eHZYSY6lGJkkdkC0tZ_n0GHLQwVlUehVg59T5N4,4198
1569
1569
  mteb/models/model_implementations/nomic_models.py,sha256=BO6XQbX4PFa5By0opAYkxz95CcHmjxbG5DYcklxJ1l8,16986
1570
1570
  mteb/models/model_implementations/nomic_models_vision.py,sha256=AzTCWbXBonUAVub0TTxWCsBtg4WYex3vPiLlz3ULdHc,6916
1571
- mteb/models/model_implementations/nvidia_llama_nemoretriever_colemb.py,sha256=-5_kd9jeDcgVv9gdwWuvX_-bNQdhAxInf1Mqo8_BdS8,10653
1572
1571
  mteb/models/model_implementations/nvidia_models.py,sha256=r-AW1dVQbteWjexjvZgFEt_90OHNRYer_5GLuqSXRS0,26924
1572
+ mteb/models/model_implementations/nvidia_nemotron_colembed_vl.py,sha256=BMb3NG8lYpabf6FDa5zheUajbMc2E0_dyvgO6eUSzAc,11654
1573
1573
  mteb/models/model_implementations/octen_models.py,sha256=5z-t2O-iIFiOOLdZ_AK9f7GrVRg-9_vx3JNAG9dJNPE,8562
1574
1574
  mteb/models/model_implementations/openai_models.py,sha256=fE8SfSAcl20GccR8D8s-7MR9w_kO6LlN5Pm80Iwx82c,9777
1575
1575
  mteb/models/model_implementations/openclip_models.py,sha256=z2gQum16O0QhJPyxqKor3oO-_uWfnep6wSXqOFQQ2Q8,11969
1576
1576
  mteb/models/model_implementations/opensearch_neural_sparse_models.py,sha256=J5FEvKWQUiBusL6PHcrRuRRJOQ-iMwOSu1fX0pblXhk,8941
1577
- mteb/models/model_implementations/ops_colqwen3_models.py,sha256=5vg5d1_WfVGMgtIwkh6zf2-Paum6V35XcKEvLfRyRzs,7437
1577
+ mteb/models/model_implementations/ops_colqwen3_models.py,sha256=tqQ9MZbUAygeeclliYFwxvclAt2OwATYRqs3taSkK2U,7503
1578
1578
  mteb/models/model_implementations/ops_moa_models.py,sha256=Ah7L78mqC9pH8t6sf1OWXOLjouVUpAutt6lZ0np7eMM,2655
1579
1579
  mteb/models/model_implementations/ordalietech_solon_embeddings_mini_beta_1_1.py,sha256=xv1ftJeMND4lpeKYC3RLQB4nhdiYy0wCxrzEjUj4gSg,1114
1580
1580
  mteb/models/model_implementations/pawan_models.py,sha256=iyzh6NSPZKU9znJYEDPjJNIqvkyuKPAol5TcILuq1Is,1225
@@ -2647,9 +2647,9 @@ mteb/types/_metadata.py,sha256=NN-W0S6a5TDV7UkpRx1pyWtGF4TyyCyoPUfHOwdeci8,2290
2647
2647
  mteb/types/_result.py,sha256=UKNokV9pu3G74MGebocU512aU_fFU9I9nPKnrG9Q0iE,1035
2648
2648
  mteb/types/_string_validators.py,sha256=PY-dYq4E8O50VS3bLYdldPWp400fl_WzUjfVSkNWe8U,523
2649
2649
  mteb/types/statistics.py,sha256=gElgSShKBXpfcqaZHhU_d2UHln1CyzUj8FN8KFun_UA,4087
2650
- mteb-2.7.19.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2651
- mteb-2.7.19.dist-info/METADATA,sha256=y3sFllzuYQsMdkp6mwS6f6bCkQH4hibXb44oEMMCQsY,14348
2652
- mteb-2.7.19.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
2653
- mteb-2.7.19.dist-info/entry_points.txt,sha256=8IJoEJFKoDHmVnNev-qJ9pp4Ln7_1-ma9QsXnzVCzGU,39
2654
- mteb-2.7.19.dist-info/top_level.txt,sha256=OLVIjcQAlWBz0bdmutKlWHLF42FF0hp4uVAg3ZyiG4U,5
2655
- mteb-2.7.19.dist-info/RECORD,,
2650
+ mteb-2.7.21.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2651
+ mteb-2.7.21.dist-info/METADATA,sha256=wsI05ECfej7Ql49z9pJnJo0Ompp8z3jaM3y-jaI6kz8,15007
2652
+ mteb-2.7.21.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
2653
+ mteb-2.7.21.dist-info/entry_points.txt,sha256=8IJoEJFKoDHmVnNev-qJ9pp4Ln7_1-ma9QsXnzVCzGU,39
2654
+ mteb-2.7.21.dist-info/top_level.txt,sha256=OLVIjcQAlWBz0bdmutKlWHLF42FF0hp4uVAg3ZyiG4U,5
2655
+ mteb-2.7.21.dist-info/RECORD,,
File without changes