mteb 2.5.5__py3-none-any.whl → 2.6.0__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/cli/build_cli.py CHANGED
@@ -361,6 +361,95 @@ def _add_create_meta_parser(subparsers) -> None:
361
361
  parser.set_defaults(func=_create_meta)
362
362
 
363
363
 
364
+ def _add_leaderboard_parser(subparsers) -> None:
365
+ parser = subparsers.add_parser("leaderboard", help="Launch the MTEB leaderboard")
366
+
367
+ parser.add_argument(
368
+ "--cache-path",
369
+ type=str,
370
+ help="Path to the cache folder containing model results",
371
+ required=False,
372
+ default=None,
373
+ )
374
+ parser.add_argument(
375
+ "--host",
376
+ type=str,
377
+ default="0.0.0.0",
378
+ help="Host to run the leaderboard server on",
379
+ )
380
+ parser.add_argument(
381
+ "--port",
382
+ type=int,
383
+ default=7860,
384
+ help="Port to run the leaderboard server on",
385
+ )
386
+ parser.add_argument(
387
+ "--share",
388
+ action="store_true",
389
+ default=False,
390
+ help="Create a public URL for the leaderboard",
391
+ )
392
+
393
+ parser.set_defaults(func=_leaderboard)
394
+
395
+
396
+ def _leaderboard(args: argparse.Namespace) -> None:
397
+ """Launch the MTEB leaderboard with specified cache path."""
398
+ # Import leaderboard module only when needed to avoid requiring leaderboard dependencies
399
+ # for other CLI commands
400
+ try:
401
+ import gradio as gr
402
+
403
+ from mteb.leaderboard import get_leaderboard_app
404
+ except ImportError as e:
405
+ raise ImportError(
406
+ "Seems like some dependencies are not installed. "
407
+ + "You can likely install these using: `pip install mteb[leaderboard]`. "
408
+ + f"{e}"
409
+ )
410
+
411
+ cache_path = args.cache_path
412
+
413
+ if cache_path:
414
+ logger.info(f"Using cache path: {cache_path}")
415
+ cache = ResultCache(cache_path)
416
+ else:
417
+ cache = ResultCache()
418
+ logger.info(f"Using default cache path: {cache.cache_path}")
419
+
420
+ app = get_leaderboard_app(cache)
421
+
422
+ logger.info(f"Starting leaderboard on {args.host}:{args.port}")
423
+ if args.share:
424
+ logger.info("Creating public URL...")
425
+
426
+ logging.getLogger("mteb.load_results.task_results").setLevel(
427
+ logging.ERROR
428
+ ) # Warnings related to task split
429
+ logging.getLogger("mteb.model_meta").setLevel(
430
+ logging.ERROR
431
+ ) # Warning related to model metadata (fetch_from_hf=False)
432
+ logging.getLogger("mteb.load_results.benchmark_results").setLevel(
433
+ logging.ERROR
434
+ ) # Warning related to model metadata (fetch_from_hf=False)
435
+ warnings.filterwarnings("ignore", message="Couldn't get scores for .* due to .*")
436
+
437
+ # Head content for Tailwind CSS
438
+ head = """
439
+ <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
440
+ """
441
+
442
+ app.launch(
443
+ server_name=args.host,
444
+ server_port=args.port,
445
+ share=args.share,
446
+ theme=gr.themes.Soft(
447
+ font=[gr.themes.GoogleFont("Roboto Mono"), "Arial", "sans-serif"],
448
+ ),
449
+ head=head,
450
+ )
451
+
452
+
364
453
  def build_cli() -> argparse.ArgumentParser:
365
454
  """Builds the argument parser for the MTEB CLI.
366
455
 
@@ -380,6 +469,7 @@ def build_cli() -> argparse.ArgumentParser:
380
469
  _add_available_tasks_parser(subparsers)
381
470
  _add_available_benchmarks_parser(subparsers)
382
471
  _add_create_meta_parser(subparsers)
472
+ _add_leaderboard_parser(subparsers)
383
473
 
384
474
  return parser
385
475
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mteb
3
- Version: 2.5.5
3
+ Version: 2.6.0
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>
@@ -65,7 +65,7 @@ mteb/benchmarks/benchmarks/benchmarks.py,sha256=48yX0qsPL07rr14ygT28qQrCF7MBhFdr
65
65
  mteb/benchmarks/benchmarks/rteb_benchmarks.py,sha256=QnCSrTTaBfcRlAQp2Nu81tgv1idMXqiM16Fp2zKJ5Ys,10607
66
66
  mteb/cli/__init__.py,sha256=v-csUr3eUZElIvrGB6QGtaIdndDfNWEe9oZchsGsJpg,64
67
67
  mteb/cli/_display_tasks.py,sha256=pWKupzak8uxEIwJZbYpZpteeVprOgVT9Wr0HYeypitQ,2206
68
- mteb/cli/build_cli.py,sha256=y3Pr6wBy1Y0F1NDkHWdCCtNvEXGmtSVBJfh-nGv9TLg,12543
68
+ mteb/cli/build_cli.py,sha256=ySOOv3B4IEBZjJWzi1Nq83tBmY92XmDUUI62xHQPyVM,15327
69
69
  mteb/cli/generate_model_card.py,sha256=wX1ApQHCbox9z8QIiHSomcbTiCIHmsoUTnsxmAv7e-g,4945
70
70
  mteb/descriptive_stats/BitextMining/BUCC.json,sha256=7zXoJaZacNdqMSG60jPZGIDJ1is_bxbVlcrVyImPRxw,3745
71
71
  mteb/descriptive_stats/BitextMining/BUCC.v2.json,sha256=IRPOKaIaUD31okNe12nQV2E1JeYK_Fo25Tz7d-utATM,3716
@@ -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.5.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2607
- mteb-2.5.5.dist-info/METADATA,sha256=9Ta6P3mxIJeO4otx8KyizC9A4mgWvQk5RW3sx_PvgL8,13990
2608
- mteb-2.5.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2609
- mteb-2.5.5.dist-info/entry_points.txt,sha256=8IJoEJFKoDHmVnNev-qJ9pp4Ln7_1-ma9QsXnzVCzGU,39
2610
- mteb-2.5.5.dist-info/top_level.txt,sha256=OLVIjcQAlWBz0bdmutKlWHLF42FF0hp4uVAg3ZyiG4U,5
2611
- mteb-2.5.5.dist-info/RECORD,,
2606
+ mteb-2.6.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2607
+ mteb-2.6.0.dist-info/METADATA,sha256=lXwlMqcxVWP8VVWUhVizNyw_D2QlYXL7qQmRqDhTqvk,13990
2608
+ mteb-2.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
2609
+ mteb-2.6.0.dist-info/entry_points.txt,sha256=8IJoEJFKoDHmVnNev-qJ9pp4Ln7_1-ma9QsXnzVCzGU,39
2610
+ mteb-2.6.0.dist-info/top_level.txt,sha256=OLVIjcQAlWBz0bdmutKlWHLF42FF0hp4uVAg3ZyiG4U,5
2611
+ mteb-2.6.0.dist-info/RECORD,,
File without changes