mteb 2.6.0__py3-none-any.whl → 2.6.1__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.
- mteb/cache.py +134 -0
- mteb/leaderboard/app.py +154 -33
- mteb/models/get_model_meta.py +7 -0
- mteb/models/model_implementations/octen_models.py +29 -0
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/METADATA +1 -1
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/RECORD +10 -10
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/WHEEL +0 -0
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/entry_points.txt +0 -0
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/licenses/LICENSE +0 -0
- {mteb-2.6.0.dist-info → mteb-2.6.1.dist-info}/top_level.txt +0 -0
mteb/cache.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import gzip
|
|
2
|
+
import io
|
|
1
3
|
import json
|
|
2
4
|
import logging
|
|
3
5
|
import os
|
|
@@ -9,6 +11,8 @@ from collections.abc import Iterable, Sequence
|
|
|
9
11
|
from pathlib import Path
|
|
10
12
|
from typing import cast
|
|
11
13
|
|
|
14
|
+
import requests
|
|
15
|
+
|
|
12
16
|
import mteb
|
|
13
17
|
from mteb.abstasks import AbsTask
|
|
14
18
|
from mteb.benchmarks.benchmark import Benchmark
|
|
@@ -276,6 +280,136 @@ class ResultCache:
|
|
|
276
280
|
|
|
277
281
|
return results_directory
|
|
278
282
|
|
|
283
|
+
def _download_cached_results_from_branch(
|
|
284
|
+
self,
|
|
285
|
+
branch: str = "cached-data",
|
|
286
|
+
filename: str = "__cached_results.json.gz",
|
|
287
|
+
output_path: Path | None = None,
|
|
288
|
+
remote: str = "https://github.com/embeddings-benchmark/results",
|
|
289
|
+
timeout: int = 60,
|
|
290
|
+
max_size_mb: int = 500,
|
|
291
|
+
) -> Path:
|
|
292
|
+
"""Download pre-computed cached results from a specific branch.
|
|
293
|
+
|
|
294
|
+
This is significantly faster than download_from_remote() since it downloads
|
|
295
|
+
only a compressed cache file instead of cloning the entire repository.
|
|
296
|
+
|
|
297
|
+
The method performs the following steps:
|
|
298
|
+
1. Downloads a gzipped JSON file from the specified branch
|
|
299
|
+
2. Validates file size and content type
|
|
300
|
+
3. Decompresses the gzip content
|
|
301
|
+
4. Writes the decompressed JSON to disk
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
branch: Branch name to download from (default: "cached-data")
|
|
305
|
+
filename: Name of the cached results file (default: "__cached_results.json.gz")
|
|
306
|
+
output_path: Where to save the file. If None, uses mteb/leaderboard/__cached_results.json
|
|
307
|
+
remote: Base URL of the results repository
|
|
308
|
+
timeout: Request timeout in seconds (default: 60)
|
|
309
|
+
max_size_mb: Maximum allowed file size in megabytes (default: 500)
|
|
310
|
+
|
|
311
|
+
Returns:
|
|
312
|
+
Path to the downloaded and decompressed cache file
|
|
313
|
+
|
|
314
|
+
Raises:
|
|
315
|
+
requests.exceptions.RequestException: On HTTP errors
|
|
316
|
+
ValueError: On validation failures (size, content-type)
|
|
317
|
+
gzip.BadGzipFile: If content is not valid gzip
|
|
318
|
+
UnicodeDecodeError: If content cannot be decoded as UTF-8
|
|
319
|
+
PermissionError: If file cannot be written due to permissions
|
|
320
|
+
OSError: On other file system errors
|
|
321
|
+
|
|
322
|
+
Examples:
|
|
323
|
+
>>> from mteb.cache import ResultCache
|
|
324
|
+
>>> cache = ResultCache()
|
|
325
|
+
>>> # Download optimized cached results
|
|
326
|
+
>>> cache_file = cache._download_cached_results_from_branch()
|
|
327
|
+
>>> # Use custom output path
|
|
328
|
+
>>> cache_file = cache._download_cached_results_from_branch(
|
|
329
|
+
... output_path=Path("/tmp/my_cache.json")
|
|
330
|
+
... )
|
|
331
|
+
"""
|
|
332
|
+
if output_path is None:
|
|
333
|
+
# Default to saving in mteb/leaderboard/__cached_results.json
|
|
334
|
+
# Get the mteb package directory (parent of this file)
|
|
335
|
+
mteb_package_dir = Path(__file__).parent
|
|
336
|
+
output_path = mteb_package_dir / "leaderboard" / "__cached_results.json"
|
|
337
|
+
|
|
338
|
+
# Extract repository owner and name from the remote URL
|
|
339
|
+
# e.g., "https://github.com/embeddings-benchmark/results" -> "embeddings-benchmark/results"
|
|
340
|
+
repo_path = remote.replace("https://github.com/", "").replace(
|
|
341
|
+
"http://github.com/", ""
|
|
342
|
+
)
|
|
343
|
+
|
|
344
|
+
url = f"https://raw.githubusercontent.com/{repo_path}/{branch}/{filename}"
|
|
345
|
+
logger.info(f"Downloading cached results from {url}")
|
|
346
|
+
|
|
347
|
+
# Step 1: Download with validation
|
|
348
|
+
max_size_bytes = max_size_mb * 1024 * 1024
|
|
349
|
+
|
|
350
|
+
try:
|
|
351
|
+
response = requests.get(url, timeout=timeout)
|
|
352
|
+
response.raise_for_status()
|
|
353
|
+
|
|
354
|
+
# Validate content-type header
|
|
355
|
+
content_type = response.headers.get("content-type", "").lower()
|
|
356
|
+
expected_content_types = [
|
|
357
|
+
"application/gzip",
|
|
358
|
+
"application/octet-stream",
|
|
359
|
+
"application/x-gzip",
|
|
360
|
+
]
|
|
361
|
+
if content_type and not any(
|
|
362
|
+
ct in content_type for ct in expected_content_types
|
|
363
|
+
):
|
|
364
|
+
raise Exception(
|
|
365
|
+
f"Unexpected content-type: {content_type}. Expected one of: {expected_content_types}"
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
# Validate file size
|
|
369
|
+
content_length = len(response.content)
|
|
370
|
+
if content_length > max_size_bytes:
|
|
371
|
+
raise ValueError(
|
|
372
|
+
f"Downloaded file too large: {content_length} bytes (max: {max_size_bytes})"
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
logger.info(
|
|
376
|
+
f"HTTP request successful, content length: {content_length} bytes"
|
|
377
|
+
)
|
|
378
|
+
content = response.content
|
|
379
|
+
|
|
380
|
+
except Exception as e:
|
|
381
|
+
logger.error(f"Unexpected HTTP error: {type(e).__name__}: {e}")
|
|
382
|
+
raise e
|
|
383
|
+
|
|
384
|
+
# Step 2: Decompress gzip data
|
|
385
|
+
logger.info("Attempting gzip decompression...")
|
|
386
|
+
|
|
387
|
+
try:
|
|
388
|
+
with gzip.open(io.BytesIO(content), "rt", encoding="utf-8") as gz_file:
|
|
389
|
+
data = gz_file.read()
|
|
390
|
+
logger.info(f"Decompression successful, data length: {len(data)} chars")
|
|
391
|
+
|
|
392
|
+
except Exception as e:
|
|
393
|
+
logger.error(f"Unexpected decompression error: {type(e).__name__}: {e}")
|
|
394
|
+
raise e
|
|
395
|
+
|
|
396
|
+
# Step 3: Write to disk
|
|
397
|
+
logger.info(f"Attempting to write to: {output_path}")
|
|
398
|
+
|
|
399
|
+
# Check parent directory exists and is writable
|
|
400
|
+
output_path.parent.mkdir(parents=True, exist_ok=True)
|
|
401
|
+
|
|
402
|
+
try:
|
|
403
|
+
output_path.write_text(data, encoding="utf-8")
|
|
404
|
+
logger.info(
|
|
405
|
+
f"File write successful, size: {output_path.stat().st_size} bytes"
|
|
406
|
+
)
|
|
407
|
+
except Exception as e:
|
|
408
|
+
logger.error(f"Unexpected file write error: {type(e).__name__}: {e}")
|
|
409
|
+
raise e
|
|
410
|
+
|
|
411
|
+
return output_path
|
|
412
|
+
|
|
279
413
|
def clear_cache(self) -> None:
|
|
280
414
|
"""Clear the local cache directory."""
|
|
281
415
|
if self.cache_path.exists() and self.cache_path.is_dir():
|
mteb/leaderboard/app.py
CHANGED
|
@@ -5,7 +5,7 @@ import tempfile
|
|
|
5
5
|
import time
|
|
6
6
|
import warnings
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import Literal
|
|
8
|
+
from typing import Literal, get_args
|
|
9
9
|
from urllib.parse import urlencode
|
|
10
10
|
|
|
11
11
|
import cachetools
|
|
@@ -29,40 +29,115 @@ from mteb.leaderboard.table import (
|
|
|
29
29
|
apply_summary_styling_from_benchmark,
|
|
30
30
|
)
|
|
31
31
|
from mteb.leaderboard.text_segments import ACKNOWLEDGEMENT, FAQ
|
|
32
|
+
from mteb.models.model_meta import MODEL_TYPES
|
|
32
33
|
|
|
33
34
|
logger = logging.getLogger(__name__)
|
|
34
35
|
|
|
36
|
+
|
|
35
37
|
LANGUAGE: list[str] = list({l for t in mteb.get_tasks() for l in t.metadata.languages})
|
|
38
|
+
MODEL_TYPE_CHOICES = list(get_args(MODEL_TYPES))
|
|
36
39
|
|
|
37
40
|
|
|
38
41
|
def _load_results(cache: ResultCache) -> BenchmarkResults:
|
|
42
|
+
"""Load benchmark results using an optimized caching strategy.
|
|
43
|
+
|
|
44
|
+
This function implements a two-tier caching strategy for faster leaderboard startup:
|
|
45
|
+
|
|
46
|
+
1. **Primary Strategy (Fast)**: Download pre-computed cached results from the
|
|
47
|
+
'cached-data' branch as a compressed JSON file (~2MB vs ~200MB full repo).
|
|
48
|
+
This avoids the need to clone the entire results repository and provides
|
|
49
|
+
near-instantaneous loading for most users.
|
|
50
|
+
|
|
51
|
+
2. **Fallback Strategy (Slower)**: If the cached download fails, fall back to
|
|
52
|
+
the original approach of downloading the full results repository and
|
|
53
|
+
building the cache from scratch.
|
|
54
|
+
|
|
55
|
+
The cached results file contains pre-aggregated benchmark data that eliminates
|
|
56
|
+
the need for expensive operations like task selection and revision joining
|
|
57
|
+
during app startup.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
cache: ResultCache instance used for both optimized and fallback operations
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
BenchmarkResults: Complete benchmark results ready for leaderboard display
|
|
64
|
+
|
|
65
|
+
Raises:
|
|
66
|
+
Various exceptions related to network issues, file I/O, or data validation
|
|
67
|
+
are logged and may cause fallback to the slower repository-based approach.
|
|
68
|
+
"""
|
|
39
69
|
start_time = time.time()
|
|
40
70
|
results_cache_path = Path(__file__).parent.joinpath("__cached_results.json")
|
|
71
|
+
|
|
41
72
|
if not results_cache_path.exists():
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
load_start = time.time()
|
|
48
|
-
all_model_names = [model_meta.name for model_meta in mteb.get_model_metas()]
|
|
49
|
-
|
|
50
|
-
all_results = cache.load_results(
|
|
51
|
-
models=all_model_names,
|
|
52
|
-
only_main_score=True,
|
|
53
|
-
require_model_meta=False,
|
|
54
|
-
include_remote=True,
|
|
73
|
+
# First try to download the cached results file from the cached-data branch
|
|
74
|
+
# This is faster than cloning the entire results repository
|
|
75
|
+
logger.info(
|
|
76
|
+
"Cached results not found, trying to download from cached-data branch..."
|
|
55
77
|
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
# Use ResultCache's optimized download method
|
|
81
|
+
# Default saves to mteb/leaderboard/__cached_results.json
|
|
82
|
+
results_cache_path = cache._download_cached_results_from_branch()
|
|
83
|
+
download_time = time.time() - start_time
|
|
84
|
+
logger.info(
|
|
85
|
+
f"Downloaded cached results from cached-data branch in {download_time:.2f}s"
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
except Exception as e:
|
|
89
|
+
logger.error(
|
|
90
|
+
f"Failed to download from cached-data branch: {type(e).__name__}: {e}"
|
|
91
|
+
)
|
|
92
|
+
logger.info("Falling back to downloading full remote repository...")
|
|
93
|
+
|
|
94
|
+
# Fall back to the original approach: clone the full repo
|
|
95
|
+
cache.download_from_remote()
|
|
96
|
+
download_time = time.time() - start_time
|
|
97
|
+
logger.info(f"Downloaded remote results in {download_time:.2f}s")
|
|
98
|
+
|
|
99
|
+
load_start = time.time()
|
|
100
|
+
all_model_names = [model_meta.name for model_meta in mteb.get_model_metas()]
|
|
101
|
+
|
|
102
|
+
all_results = cache.load_results(
|
|
103
|
+
models=all_model_names,
|
|
104
|
+
only_main_score=True,
|
|
105
|
+
require_model_meta=False,
|
|
106
|
+
include_remote=True,
|
|
107
|
+
)
|
|
108
|
+
load_time = time.time() - load_start
|
|
109
|
+
logger.info(f"Loaded results from cache in {load_time:.2f}s")
|
|
110
|
+
return all_results
|
|
111
|
+
|
|
112
|
+
# Load the cached results file (either pre-existing or just downloaded)
|
|
113
|
+
logger.info("Loading cached results from disk...")
|
|
114
|
+
try:
|
|
115
|
+
logger.info(f"Opening file: {results_cache_path}")
|
|
116
|
+
|
|
117
|
+
file_size = results_cache_path.stat().st_size
|
|
118
|
+
logger.info(f"File exists, size: {file_size} bytes")
|
|
119
|
+
|
|
61
120
|
with results_cache_path.open() as cache_file:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
121
|
+
logger.info("File opened successfully, attempting JSON parse...")
|
|
122
|
+
json_data = json.load(cache_file)
|
|
123
|
+
logger.info(
|
|
124
|
+
f"JSON parsed successfully, keys: {list(json_data.keys()) if isinstance(json_data, dict) else 'not a dict'}"
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
logger.info("Attempting BenchmarkResults.from_validated...")
|
|
128
|
+
results = mteb.BenchmarkResults.from_validated(**json_data)
|
|
129
|
+
logger.info("BenchmarkResults.from_validated successful")
|
|
130
|
+
|
|
131
|
+
except Exception as e:
|
|
132
|
+
# TODO: Handle the case when we fail to load cached results from disk.
|
|
133
|
+
logger.error(
|
|
134
|
+
f"Failed to load cached results from disk: {type(e).__name__}: {e}"
|
|
135
|
+
)
|
|
136
|
+
raise
|
|
137
|
+
|
|
138
|
+
total_time = time.time() - start_time
|
|
139
|
+
logger.info(f"Loaded cached results in {total_time:.2f}s")
|
|
140
|
+
return results
|
|
66
141
|
|
|
67
142
|
|
|
68
143
|
def _produce_benchmark_link(benchmark_name: str, request: gr.Request) -> str:
|
|
@@ -187,6 +262,7 @@ def _filter_models(
|
|
|
187
262
|
instructions: bool | None,
|
|
188
263
|
max_model_size: int,
|
|
189
264
|
zero_shot_setting: Literal["only_zero_shot", "allow_all", "remove_unknown"],
|
|
265
|
+
model_types: list[str] | None,
|
|
190
266
|
):
|
|
191
267
|
lower, upper = 0, max_model_size
|
|
192
268
|
# Setting to None, when the user doesn't specify anything
|
|
@@ -205,6 +281,7 @@ def _filter_models(
|
|
|
205
281
|
use_instructions=instructions,
|
|
206
282
|
frameworks=compatibility,
|
|
207
283
|
n_parameters_range=(lower, upper),
|
|
284
|
+
model_types=model_types,
|
|
208
285
|
)
|
|
209
286
|
|
|
210
287
|
models_to_keep = set()
|
|
@@ -269,6 +346,7 @@ def _cache_on_benchmark_select(benchmark_name, all_benchmark_results):
|
|
|
269
346
|
instructions=None,
|
|
270
347
|
max_model_size=MAX_MODEL_SIZE,
|
|
271
348
|
zero_shot_setting="allow_all",
|
|
349
|
+
model_types=MODEL_TYPE_CHOICES,
|
|
272
350
|
)
|
|
273
351
|
# Sort to ensure consistency with update_models
|
|
274
352
|
initial_models = sorted(initial_models)
|
|
@@ -387,6 +465,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
387
465
|
instructions=None,
|
|
388
466
|
max_model_size=MAX_MODEL_SIZE,
|
|
389
467
|
zero_shot_setting="allow_all",
|
|
468
|
+
model_types=MODEL_TYPE_CHOICES,
|
|
390
469
|
)
|
|
391
470
|
default_filtered_scores = [
|
|
392
471
|
entry for entry in default_scores if entry["model_name"] in filtered_models
|
|
@@ -583,6 +662,12 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
583
662
|
label="Model Parameters",
|
|
584
663
|
interactive=True,
|
|
585
664
|
)
|
|
665
|
+
with gr.Column():
|
|
666
|
+
model_type_select = gr.CheckboxGroup(
|
|
667
|
+
MODEL_TYPE_CHOICES,
|
|
668
|
+
value=MODEL_TYPE_CHOICES,
|
|
669
|
+
label="Model Type",
|
|
670
|
+
)
|
|
586
671
|
|
|
587
672
|
with gr.Tab("Summary"):
|
|
588
673
|
summary_table.render()
|
|
@@ -755,7 +840,8 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
755
840
|
compatibility,
|
|
756
841
|
instructions,
|
|
757
842
|
max_model_size,
|
|
758
|
-
zero_shot
|
|
843
|
+
zero_shot,
|
|
844
|
+
model_type_select: hash(
|
|
759
845
|
(
|
|
760
846
|
id(scores),
|
|
761
847
|
hash(tuple(tasks)),
|
|
@@ -764,6 +850,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
764
850
|
hash(instructions),
|
|
765
851
|
hash(max_model_size),
|
|
766
852
|
hash(zero_shot),
|
|
853
|
+
hash(tuple(model_type_select)),
|
|
767
854
|
)
|
|
768
855
|
),
|
|
769
856
|
)
|
|
@@ -775,6 +862,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
775
862
|
instructions: bool | None,
|
|
776
863
|
max_model_size: int,
|
|
777
864
|
zero_shot: Literal["allow_all", "remove_unknown", "only_zero_shot"],
|
|
865
|
+
model_type_select: list[str],
|
|
778
866
|
):
|
|
779
867
|
start_time = time.time()
|
|
780
868
|
model_names = list({entry["model_name"] for entry in scores})
|
|
@@ -786,6 +874,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
786
874
|
instructions,
|
|
787
875
|
max_model_size,
|
|
788
876
|
zero_shot_setting=zero_shot,
|
|
877
|
+
model_types=model_type_select,
|
|
789
878
|
)
|
|
790
879
|
elapsed = time.time() - start_time
|
|
791
880
|
logger.debug(f"update_models callback: {elapsed}s")
|
|
@@ -803,6 +892,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
803
892
|
instructions,
|
|
804
893
|
max_model_size,
|
|
805
894
|
zero_shot,
|
|
895
|
+
model_type_select,
|
|
806
896
|
],
|
|
807
897
|
outputs=[models],
|
|
808
898
|
)
|
|
@@ -817,6 +907,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
817
907
|
instructions,
|
|
818
908
|
max_model_size,
|
|
819
909
|
zero_shot,
|
|
910
|
+
model_type_select,
|
|
820
911
|
],
|
|
821
912
|
outputs=[models],
|
|
822
913
|
)
|
|
@@ -830,6 +921,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
830
921
|
instructions,
|
|
831
922
|
max_model_size,
|
|
832
923
|
zero_shot,
|
|
924
|
+
model_type_select,
|
|
833
925
|
],
|
|
834
926
|
outputs=[models],
|
|
835
927
|
)
|
|
@@ -843,6 +935,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
843
935
|
instructions,
|
|
844
936
|
max_model_size,
|
|
845
937
|
zero_shot,
|
|
938
|
+
model_type_select,
|
|
846
939
|
],
|
|
847
940
|
outputs=[models],
|
|
848
941
|
)
|
|
@@ -856,6 +949,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
856
949
|
instructions,
|
|
857
950
|
max_model_size,
|
|
858
951
|
zero_shot,
|
|
952
|
+
model_type_select,
|
|
859
953
|
],
|
|
860
954
|
outputs=[models],
|
|
861
955
|
)
|
|
@@ -869,6 +963,7 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
869
963
|
instructions,
|
|
870
964
|
max_model_size,
|
|
871
965
|
zero_shot,
|
|
966
|
+
model_type_select,
|
|
872
967
|
],
|
|
873
968
|
outputs=[models],
|
|
874
969
|
)
|
|
@@ -882,6 +977,21 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
882
977
|
instructions,
|
|
883
978
|
max_model_size,
|
|
884
979
|
zero_shot,
|
|
980
|
+
model_type_select,
|
|
981
|
+
],
|
|
982
|
+
outputs=[models],
|
|
983
|
+
)
|
|
984
|
+
model_type_select.change(
|
|
985
|
+
update_models,
|
|
986
|
+
inputs=[
|
|
987
|
+
scores,
|
|
988
|
+
task_select,
|
|
989
|
+
availability,
|
|
990
|
+
compatibility,
|
|
991
|
+
instructions,
|
|
992
|
+
max_model_size,
|
|
993
|
+
zero_shot,
|
|
994
|
+
model_type_select,
|
|
885
995
|
],
|
|
886
996
|
outputs=[models],
|
|
887
997
|
)
|
|
@@ -1023,15 +1133,26 @@ def get_leaderboard_app(cache: ResultCache = ResultCache()) -> gr.Blocks:
|
|
|
1023
1133
|
|
|
1024
1134
|
|
|
1025
1135
|
if __name__ == "__main__":
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
logging.
|
|
1030
|
-
logging.
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1136
|
+
import os
|
|
1137
|
+
|
|
1138
|
+
# Add process ID to logging for multiprocessing debugging
|
|
1139
|
+
logging.basicConfig(
|
|
1140
|
+
level=logging.INFO,
|
|
1141
|
+
format="%(asctime)s - PID:%(process)d - %(name)s - %(levelname)s - %(message)s",
|
|
1142
|
+
force=True, # Override any existing handlers
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1145
|
+
# Flush log handlers immediately (helpful for multiprocessing)
|
|
1146
|
+
for handler in logging.root.handlers:
|
|
1147
|
+
handler.flush()
|
|
1148
|
+
|
|
1149
|
+
logger.info(f"Starting leaderboard app in process {os.getpid()}")
|
|
1150
|
+
|
|
1151
|
+
# Suppress specific WARNING messages while keeping INFO level for the app
|
|
1152
|
+
logging.getLogger("mteb.results.task_result").setLevel(logging.ERROR)
|
|
1153
|
+
logging.getLogger("mteb.models.model_meta").setLevel(logging.ERROR)
|
|
1154
|
+
logging.getLogger("mteb.results.benchmark_results").setLevel(logging.ERROR)
|
|
1155
|
+
|
|
1035
1156
|
warnings.filterwarnings("ignore", message="Couldn't get scores for .* due to .*")
|
|
1036
1157
|
|
|
1037
1158
|
app = get_leaderboard_app()
|
mteb/models/get_model_meta.py
CHANGED
|
@@ -21,6 +21,7 @@ def get_model_metas(
|
|
|
21
21
|
n_parameters_range: tuple[int | None, int | None] = (None, None),
|
|
22
22
|
use_instructions: bool | None = None,
|
|
23
23
|
zero_shot_on: list[AbsTask] | None = None,
|
|
24
|
+
model_types: Iterable[str] | None = None,
|
|
24
25
|
) -> list[ModelMeta]:
|
|
25
26
|
"""Load all models' metadata that fit the specified criteria.
|
|
26
27
|
|
|
@@ -33,6 +34,7 @@ def get_model_metas(
|
|
|
33
34
|
If (None, None), this filter is ignored.
|
|
34
35
|
use_instructions: Whether to filter by models that use instructions. If None, all models are included.
|
|
35
36
|
zero_shot_on: A list of tasks on which the model is zero-shot. If None this filter is ignored.
|
|
37
|
+
model_types: A list of model types to filter by. If None, all model types are included.
|
|
36
38
|
|
|
37
39
|
Returns:
|
|
38
40
|
A list of model metadata objects that fit the specified criteria.
|
|
@@ -41,6 +43,7 @@ def get_model_metas(
|
|
|
41
43
|
model_names = set(model_names) if model_names is not None else None
|
|
42
44
|
languages = set(languages) if languages is not None else None
|
|
43
45
|
frameworks = set(frameworks) if frameworks is not None else None
|
|
46
|
+
model_types_set = set(model_types) if model_types is not None else None
|
|
44
47
|
for model_meta in MODEL_REGISTRY.values():
|
|
45
48
|
if (model_names is not None) and (model_meta.name not in model_names):
|
|
46
49
|
continue
|
|
@@ -57,6 +60,10 @@ def get_model_metas(
|
|
|
57
60
|
model_meta.use_instructions != use_instructions
|
|
58
61
|
):
|
|
59
62
|
continue
|
|
63
|
+
if model_types_set is not None and not model_types_set.intersection(
|
|
64
|
+
model_meta.model_type
|
|
65
|
+
):
|
|
66
|
+
continue
|
|
60
67
|
|
|
61
68
|
lower, upper = n_parameters_range
|
|
62
69
|
n_parameters = model_meta.n_parameters
|
|
@@ -163,6 +163,35 @@ _PREDEFINED_PROMPTS = {
|
|
|
163
163
|
"German1Retrieval": "Given a query, retrieve relevant passages",
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
Octen_Embedding_4B = ModelMeta(
|
|
167
|
+
loader=InstructSentenceTransformerModel,
|
|
168
|
+
loader_kwargs=dict(
|
|
169
|
+
instruction_template=instruction_template,
|
|
170
|
+
apply_instruction_to_passages=True,
|
|
171
|
+
prompts_dict=_PREDEFINED_PROMPTS,
|
|
172
|
+
max_seq_length=18480,
|
|
173
|
+
model_kwargs={"torch_dtype": "bfloat16"},
|
|
174
|
+
),
|
|
175
|
+
name="bflhc/Octen-Embedding-4B",
|
|
176
|
+
languages=multilingual_langs,
|
|
177
|
+
open_weights=True,
|
|
178
|
+
revision="6e188e3b072c3e3678b235ad84e6e97bcbb71e8f",
|
|
179
|
+
release_date="2025-12-30",
|
|
180
|
+
n_parameters=4021774336,
|
|
181
|
+
memory_usage_mb=7671,
|
|
182
|
+
embed_dim=2560,
|
|
183
|
+
max_tokens=32768,
|
|
184
|
+
license="apache-2.0",
|
|
185
|
+
reference="https://huggingface.co/bflhc/Octen-Embedding-4B",
|
|
186
|
+
similarity_fn_name="cosine",
|
|
187
|
+
framework=["Sentence Transformers", "PyTorch"],
|
|
188
|
+
use_instructions=True,
|
|
189
|
+
public_training_code=None,
|
|
190
|
+
public_training_data=None,
|
|
191
|
+
training_datasets=training_data,
|
|
192
|
+
citation=OCTEN_CITATION,
|
|
193
|
+
adapted_from="Qwen/Qwen3-Embedding-4B",
|
|
194
|
+
)
|
|
166
195
|
|
|
167
196
|
Octen_Embedding_8B = ModelMeta(
|
|
168
197
|
loader=InstructSentenceTransformerModel,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mteb
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.1
|
|
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>
|
|
@@ -5,7 +5,7 @@ mteb/_helpful_enum.py,sha256=jh73N1jlcpg7RGz4bj8UpctiMNvqvHpp9wrB7SYEzIU,510
|
|
|
5
5
|
mteb/_log_once.py,sha256=-tUKzxGQzf2LZSuQXi97oYFXMta1B6GEYXd7BPqssvY,1095
|
|
6
6
|
mteb/_requires_package.py,sha256=eHg_TD9BVZRzNCcQQrUP17d8M1DF_vOd_tVx54AmAnM,3017
|
|
7
7
|
mteb/_set_seed.py,sha256=HPlPRl__Pe6IG-4UgJqTfplcivJ_wA2kaClbXoHQedM,1178
|
|
8
|
-
mteb/cache.py,sha256=
|
|
8
|
+
mteb/cache.py,sha256=KYUtXTMwSeqaDbJR5b65gZ0KMUpi7GzEgEsy08ocTJ0,26975
|
|
9
9
|
mteb/deprecated_evaluator.py,sha256=LCnM-kG2SBkh-xqVd4MurExsVMlFOIycSb7sHz2S_Cw,27634
|
|
10
10
|
mteb/evaluate.py,sha256=6h06XsolgVCJEq9j6NA5ebwH2rSLsyIdtrxHanlqQfk,19185
|
|
11
11
|
mteb/filter_tasks.py,sha256=D9g2o79aQiA5va7u_QKtMlZNDUmYwZGqCDpaKhBimWQ,7335
|
|
@@ -1439,14 +1439,14 @@ mteb/languages/language_family.json,sha256=OUGcHeOIPcZPb2FWmYLhxTS0JxjK5y3Fo6x0P
|
|
|
1439
1439
|
mteb/languages/language_scripts.py,sha256=p7AM10Fe3b3EOMlPj8i5_MDjtyoH4FMCCBv_zrABWBg,4053
|
|
1440
1440
|
mteb/languages/programming_languages.py,sha256=zxAakT3OSUnAuTnQ34VyeFIECnNXMlleZmAake6jsZE,211
|
|
1441
1441
|
mteb/leaderboard/__init__.py,sha256=991roXmtRwEQysV-37hWEzWpkvPgMCGRqZTHR-hm2io,88
|
|
1442
|
-
mteb/leaderboard/app.py,sha256=
|
|
1442
|
+
mteb/leaderboard/app.py,sha256=4-IacMDOtGwwMRrtYNSxqcuC8PxE04bJ3L9bTz5B2nM,41939
|
|
1443
1443
|
mteb/leaderboard/benchmark_selector.py,sha256=qd-2L20RQ4ACke01UlytkhZok1dkWgfUlXzfET52kGc,7956
|
|
1444
1444
|
mteb/leaderboard/figures.py,sha256=cfOK82rRf-7sCjyP7GBxh4ezhOIt0OhD0_86mKtzLrg,7530
|
|
1445
1445
|
mteb/leaderboard/table.py,sha256=KqU8aAbZ_tDp1O_qXRGWR32QnB7v_lsF6k5jxLcQVN0,10366
|
|
1446
1446
|
mteb/leaderboard/text_segments.py,sha256=iMIkS04QQjPbT-SkU0x6fOcS8xRbUYevryu9HydipKM,6570
|
|
1447
1447
|
mteb/models/__init__.py,sha256=ABTuoqiBjBtBWW3LYY7ItBHdylR6jWoy06HH0g6j6fU,910
|
|
1448
1448
|
mteb/models/abs_encoder.py,sha256=HSJTjvcPYJRsKhhZeK2r6YP241EqpovwBcAuX1NevKE,16553
|
|
1449
|
-
mteb/models/get_model_meta.py,sha256=
|
|
1449
|
+
mteb/models/get_model_meta.py,sha256=Pg9GFY-Ny8snbmMXAldBSxDoTh3rzfaCBrF6n21ypzI,5981
|
|
1450
1450
|
mteb/models/instruct_wrapper.py,sha256=e6id0oNMQd7ulDCkB-2IGaF2JK5S3Tiwcn-QFG-ufDk,9292
|
|
1451
1451
|
mteb/models/model_meta.py,sha256=5hWcv0RfVt3RcBJ2Vsyc2_8pGP42MGNRqXOzsIe4DJ0,30397
|
|
1452
1452
|
mteb/models/models_protocols.py,sha256=D2hYWn_UBGMaKtRwBx3u0B0ni6lHJjSzTxX21XFNwIc,8917
|
|
@@ -1535,7 +1535,7 @@ mteb/models/model_implementations/nomic_models.py,sha256=oDumLKjoVlNULBYkurWPzhl
|
|
|
1535
1535
|
mteb/models/model_implementations/nomic_models_vision.py,sha256=9AQRJkPkFDPjuSqdIh8wJ0-pqS2fe_oDZzPR4Y0tOSg,6831
|
|
1536
1536
|
mteb/models/model_implementations/nvidia_llama_nemoretriever_colemb.py,sha256=phbwPnRfrEuJTlrUucI1qxcViMQWogeXQkTZbUkNsQc,6388
|
|
1537
1537
|
mteb/models/model_implementations/nvidia_models.py,sha256=OKRnlhlMyBASe-RpU_8j4_ENFdjOtNsZm5fKlnAtcAo,21633
|
|
1538
|
-
mteb/models/model_implementations/octen_models.py,sha256=
|
|
1538
|
+
mteb/models/model_implementations/octen_models.py,sha256=v4Mk6qMkK6yoMS5QomZdDWCP7ysB7CYf3VxuuOYVpu4,7481
|
|
1539
1539
|
mteb/models/model_implementations/openai_models.py,sha256=905BajYi_XyOZgqU3AeKpwIttLoUitaAyc48sTWI6Jg,9482
|
|
1540
1540
|
mteb/models/model_implementations/openclip_models.py,sha256=aFBWqHkWjHm8OfCB8RTNiaO03oaILAE2jVLR1VFZgPk,11532
|
|
1541
1541
|
mteb/models/model_implementations/opensearch_neural_sparse_models.py,sha256=hS33RteHexhkIekQVKsjx6czKr6YdWINaVa60J91Wnk,8481
|
|
@@ -2603,9 +2603,9 @@ mteb/types/_metadata.py,sha256=NN-W0S6a5TDV7UkpRx1pyWtGF4TyyCyoPUfHOwdeci8,2290
|
|
|
2603
2603
|
mteb/types/_result.py,sha256=UKNokV9pu3G74MGebocU512aU_fFU9I9nPKnrG9Q0iE,1035
|
|
2604
2604
|
mteb/types/_string_validators.py,sha256=PY-dYq4E8O50VS3bLYdldPWp400fl_WzUjfVSkNWe8U,523
|
|
2605
2605
|
mteb/types/statistics.py,sha256=GwkBPmAr18Onu-vHtzHs0PFrhCozdOMiT13HwnWL4ZM,3961
|
|
2606
|
-
mteb-2.6.
|
|
2607
|
-
mteb-2.6.
|
|
2608
|
-
mteb-2.6.
|
|
2609
|
-
mteb-2.6.
|
|
2610
|
-
mteb-2.6.
|
|
2611
|
-
mteb-2.6.
|
|
2606
|
+
mteb-2.6.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
2607
|
+
mteb-2.6.1.dist-info/METADATA,sha256=VBXwF7nBuutKGZ13DY_K_1yhTi-ZHpGNvsL_jV-4K1c,13990
|
|
2608
|
+
mteb-2.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
2609
|
+
mteb-2.6.1.dist-info/entry_points.txt,sha256=8IJoEJFKoDHmVnNev-qJ9pp4Ln7_1-ma9QsXnzVCzGU,39
|
|
2610
|
+
mteb-2.6.1.dist-info/top_level.txt,sha256=OLVIjcQAlWBz0bdmutKlWHLF42FF0hp4uVAg3ZyiG4U,5
|
|
2611
|
+
mteb-2.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|