multabench 0.0.5__tar.gz → 0.0.6__tar.gz
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.
- {multabench-0.0.5 → multabench-0.0.6}/PKG-INFO +1 -1
- {multabench-0.0.5 → multabench-0.0.6}/multabench/__init__.py +3 -1
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/abstract_model.py +4 -4
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/benchmarks/evaluate.py +3 -3
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/image_embeddings.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/text_embeddings.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/load.py +8 -6
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/splits.py +4 -1
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/sweep.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench/dino/constants.py +3 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/e5/constants.py +3 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/embed.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/jobs.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/published.py +2 -2
- {multabench-0.0.5 → multabench-0.0.6}/multabench.egg-info/PKG-INFO +1 -1
- {multabench-0.0.5 → multabench-0.0.6}/pyproject.toml +1 -1
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_core_imports.py +5 -4
- {multabench-0.0.5 → multabench-0.0.6}/LICENSE +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/README.md +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/autogluon_mm.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/benchmarks/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/catboost.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/causilo.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/contexttab.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/exaone_tabular.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/kumo_tabular.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/lgbm.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/limix2.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/mitra2.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/categorical.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/column_encoders.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/dates.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/feature_types.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/nulls.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/numerical.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/target.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/validation.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/random_forest.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/realmlp.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabdpt.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabdpt13.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabfm.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabicl_v2.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabldm.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabm.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabpfn.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabstar_v1.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/tabstar_v1p1.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/training/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/training/metrics.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/xgboost.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/collect.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/metrics.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/runs.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/utils/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/utils/constants.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/benchmark/utils/curation.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/constants.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/all_datasets.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/hub.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/info.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/objects.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/revisions.json +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/datasets/revisions.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/dino/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/dino/dino_finetune.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/dino/image_loading.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/e5/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/e5/e5_finetune.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/compute.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/embed_sweep.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/embeddings/hub.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/finetune/lora.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/finetune/train_args.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/finetune/utils.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/elo.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/embedding_cost.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/export.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/CatBoost.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Causilo.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/ConTextTab.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/EXAONE-Tabular.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Kumo-Tabular-Medium.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Kumo-Tabular-Small.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Kumo-Tabular.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/LightGBM.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/LimiX-2.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Mitra-v2.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/RandomForest.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/RealMLP.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabDPT-1.3.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabDPT.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabFM.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabICLv2.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabM.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabPFN-3.5-Fast.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabPFN-3.5.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabPFN-3.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabPFN-v2.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabPFN-v2p5.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabSTAR-v1.1.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/TabSTAR.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/XGBoost.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/leaderboard/models/Xiaomi-TabLDM.csv +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/preprocessing/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/preprocessing/discretize.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/preprocessing/splits.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/result_keys.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/__init__.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/devices.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/encoders.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/hardware.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/logging.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/profiling.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/timing.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench/utils/warnings.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench.egg-info/SOURCES.txt +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench.egg-info/dependency_links.txt +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench.egg-info/requires.txt +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/multabench.egg-info/top_level.txt +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/setup.cfg +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_collect.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_datasets_info.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_elo.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_embeddings.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_feature_types.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_hardware.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_hub.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_leaderboard_results.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_local_data_dir.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_metrics.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_official_commit.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_profiling.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_published_results.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_registry.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_space_data.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_splits.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_sweep.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_tabstar_mapping.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_text_embeddings.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_timing.py +0 -0
- {multabench-0.0.5 → multabench-0.0.6}/tests/test_warnings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multabench
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Benchmarking multimodal tabular learning: tables whose columns include text or images
|
|
5
5
|
Author: Alan Arazi, Eilam Shapira, Shoham Grunblat, Mor Ventura, Elad Hoffer, Gioia Blayer, David Holzmüller, Lennart Purucker, Gaël Varoquaux, Frank Hutter, Roi Reichart
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
from multabench.benchmark.load import data_dir_files, load_embeddings, load_split
|
|
2
2
|
from multabench.benchmark.metrics import Score, score
|
|
3
|
-
from multabench.benchmark.splits import FOLDS, REPEATS, SPLITS, Size
|
|
3
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, FOLDS, REPEATS, SPLITS, Size
|
|
4
4
|
from multabench.benchmark.utils.constants import METADATA_JSON
|
|
5
5
|
from multabench.datasets.all_datasets import Modality, MulTaBenchDatasetID
|
|
6
6
|
from multabench.datasets.hub import DATA_PARQUET, hf_repo_id
|
|
7
7
|
from multabench.datasets.info import DatasetInfo, Tier, list_datasets
|
|
8
8
|
from multabench.datasets.objects import SupervisedTask
|
|
9
9
|
from multabench.datasets.revisions import revision
|
|
10
|
+
from multabench.dino.constants import DEFAULT_IMAGE_ENCODER
|
|
11
|
+
from multabench.e5.constants import DEFAULT_TEXT_ENCODER
|
|
10
12
|
from multabench.embeddings.hub import (EMBEDDINGS_NPZ, META_JSON, CachedEncoder, embeddings_repo_id, embeds_dataset,
|
|
11
13
|
parse_encoder, repo_name)
|
|
12
14
|
from multabench.leaderboard.published import load_published_results
|
|
@@ -19,8 +19,8 @@ from multabench.baselines.preprocessing.categorical import (fit_categorical_enco
|
|
|
19
19
|
from multabench.baselines.preprocessing.numerical import fit_numerical_median, transform_numerical_features
|
|
20
20
|
from multabench.baselines.preprocessing.target import transform_preprocess_y, fit_preprocess_y
|
|
21
21
|
from multabench.benchmark.splits import Size
|
|
22
|
-
from multabench.dino.constants import ImageEncoder
|
|
23
|
-
from multabench.e5.constants import TextEncoder
|
|
22
|
+
from multabench.dino.constants import DEFAULT_IMAGE_ENCODER, ImageEncoder
|
|
23
|
+
from multabench.e5.constants import DEFAULT_TEXT_ENCODER, TextEncoder
|
|
24
24
|
from multabench.baselines.preprocessing.text_embeddings import fit_text_encoders
|
|
25
25
|
from multabench.datasets.objects import SupervisedTask
|
|
26
26
|
from multabench.utils.warnings import silence_baselines_prints
|
|
@@ -59,8 +59,8 @@ class TabularModel:
|
|
|
59
59
|
self.d_output: int = 0
|
|
60
60
|
self.image_folder = image_folder
|
|
61
61
|
self.image_column = image_column
|
|
62
|
-
self.text_encoder = text_encoder or
|
|
63
|
-
self.image_encoder = image_encoder or
|
|
62
|
+
self.text_encoder = text_encoder or DEFAULT_TEXT_ENCODER
|
|
63
|
+
self.image_encoder = image_encoder or DEFAULT_IMAGE_ENCODER
|
|
64
64
|
# A tuned encoder's cached embeddings are per fold.
|
|
65
65
|
self.fold = fold
|
|
66
66
|
self.size = size
|
|
@@ -7,7 +7,7 @@ from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
|
7
7
|
from multabench.datasets.objects import MultimodalDataset
|
|
8
8
|
from multabench.baselines.abstract_model import TabularModel
|
|
9
9
|
from multabench.benchmark.load import load_multabench_dataset, split_dataset
|
|
10
|
-
from multabench.benchmark.splits import Size
|
|
10
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, Size
|
|
11
11
|
from multabench.utils.hardware import get_hardware_dict
|
|
12
12
|
from multabench.dino.constants import IMAGE_ENCODERS, ImageEncoder
|
|
13
13
|
from multabench.e5.constants import TEXT_ENCODERS, TextEncoder
|
|
@@ -20,7 +20,7 @@ def evaluate_on_loaded_dataset(model_cls: Type[TabularModel],
|
|
|
20
20
|
dataset: MultimodalDataset,
|
|
21
21
|
fold: int,
|
|
22
22
|
device: torch.device,
|
|
23
|
-
size: Size =
|
|
23
|
+
size: Size = DEFAULT_SIZE,
|
|
24
24
|
verbose: bool = False,
|
|
25
25
|
text_encoder: TextEncoder | None = None,
|
|
26
26
|
image_encoder: ImageEncoder | None = None) -> Dict:
|
|
@@ -75,7 +75,7 @@ def evaluate_on_dataset(model_cls: Type[TabularModel],
|
|
|
75
75
|
dataset_id: MulTaBenchDatasetID,
|
|
76
76
|
fold: int,
|
|
77
77
|
device: torch.device,
|
|
78
|
-
size: Size =
|
|
78
|
+
size: Size = DEFAULT_SIZE,
|
|
79
79
|
verbose: bool = False,
|
|
80
80
|
text_encoder: TextEncoder | None = None,
|
|
81
81
|
image_encoder: ImageEncoder | None = None) -> Dict:
|
{multabench-0.0.5 → multabench-0.0.6}/multabench/baselines/preprocessing/image_embeddings.py
RENAMED
|
@@ -8,7 +8,7 @@ from transformers import AutoImageProcessor, AutoModel, DINOv3ViTImageProcessorF
|
|
|
8
8
|
|
|
9
9
|
from multabench.baselines.preprocessing.column_encoders import ColumnEncoder, column_caches, fit_column_encoders
|
|
10
10
|
from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
11
|
-
from multabench.dino.constants import IMAGE_ENCODERS, ImageEncoder
|
|
11
|
+
from multabench.dino.constants import DEFAULT_IMAGE_ENCODER, IMAGE_ENCODERS, ImageEncoder
|
|
12
12
|
from multabench.dino.dino_finetune import finetune_dino
|
|
13
13
|
from multabench.dino.image_loading import load_images
|
|
14
14
|
from multabench.benchmark.splits import Size
|
|
@@ -46,7 +46,7 @@ class DinoColumnEncoder(ColumnEncoder):
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
def fit_image_encoders(x: DataFrame, image_features: Set[str], device: torch.device, image_folder: Optional[str],
|
|
49
|
-
encoder: ImageEncoder =
|
|
49
|
+
encoder: ImageEncoder = DEFAULT_IMAGE_ENCODER, y: Optional[Series] = None, is_cls: bool = True,
|
|
50
50
|
dataset: Optional[MulTaBenchDatasetID] = None, size: Optional[Size] = None,
|
|
51
51
|
fold: Optional[int] = None) -> Tuple[Dict[str, ColumnEncoder], Dict[str, np.ndarray]]:
|
|
52
52
|
"""One encoder per image column, with the training rows' embeddings, read from the cache when the encoder has
|
|
@@ -12,7 +12,7 @@ from multabench.baselines.preprocessing.column_encoders import (PCA_COMPONENTS,
|
|
|
12
12
|
from multabench.benchmark.splits import Size
|
|
13
13
|
from multabench.constants import SEED
|
|
14
14
|
from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
15
|
-
from multabench.e5.constants import TEXT_ENCODERS, TextEncoder
|
|
15
|
+
from multabench.e5.constants import DEFAULT_TEXT_ENCODER, TEXT_ENCODERS, TextEncoder
|
|
16
16
|
from multabench.e5.e5_finetune import encode_texts_with_e5, finetune_e5, get_vanilla_e5
|
|
17
17
|
from multabench.embeddings.hub import CACHED_ENCODERS, CachedEmbeddings, e5_passages
|
|
18
18
|
from multabench.utils.timing import embedding_step
|
|
@@ -63,7 +63,7 @@ class TfidfColumnEncoder(ColumnEncoder):
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
def fit_text_encoders(x: DataFrame, text_features: Set[str], device: torch.device,
|
|
66
|
-
encoder: TextEncoder =
|
|
66
|
+
encoder: TextEncoder = DEFAULT_TEXT_ENCODER, y: Optional[Series] = None, is_cls: bool = True,
|
|
67
67
|
dataset: Optional[MulTaBenchDatasetID] = None, size: Optional[Size] = None,
|
|
68
68
|
fold: Optional[int] = None) -> Tuple[Dict[str, ColumnEncoder], Dict[str, np.ndarray]]:
|
|
69
69
|
"""One encoder per text column, with the training rows' embeddings, read from the cache when the encoder has
|
|
@@ -18,11 +18,12 @@ import numpy as np
|
|
|
18
18
|
import pandas as pd
|
|
19
19
|
from huggingface_hub import snapshot_download
|
|
20
20
|
|
|
21
|
-
from multabench.benchmark.splits import SPLITS, Size, get_split
|
|
21
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, SPLITS, Size, get_split
|
|
22
22
|
from multabench.datasets.all_datasets import Modality, MulTaBenchDatasetID, dataset_modality
|
|
23
23
|
from multabench.datasets.hub import DATA_PARQUET, IMAGES_DIR, extract_images, hf_repo_id, local_repo_dir
|
|
24
24
|
from multabench.datasets.revisions import revision
|
|
25
25
|
from multabench.datasets.objects import DatasetSplit, MultimodalDataset, SupervisedTask
|
|
26
|
+
from multabench.e5.constants import DEFAULT_TEXT_ENCODER
|
|
26
27
|
from multabench.embeddings.hub import (CACHED_ENCODERS, EMBEDDINGS_NPZ, META_JSON, CachedEmbeddings, CachedEncoder,
|
|
27
28
|
download_embeddings, embeddings_dir, embeds_dataset, encoder_inputs,
|
|
28
29
|
input_values, is_tuned, parse_encoder, read_embeddings, repo_name)
|
|
@@ -61,7 +62,7 @@ def download_dataset(dataset_id: MulTaBenchDatasetID, data_dir: Optional[str] =
|
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
def data_dir_files(dataset: str | MulTaBenchDatasetID, encoders: Sequence[str | CachedEncoder] = CACHED_ENCODERS,
|
|
64
|
-
size: Size =
|
|
65
|
+
size: Size = DEFAULT_SIZE, with_image_files: bool = True) -> List[str]:
|
|
65
66
|
"""The paths, relative to a data_dir, that the dataset's splits and its cached embeddings by each encoder read."""
|
|
66
67
|
if isinstance(dataset, str):
|
|
67
68
|
dataset = MulTaBenchDatasetID[dataset]
|
|
@@ -101,7 +102,7 @@ def load_multabench_dataset(dataset_id, data_dir: Optional[str] = None,
|
|
|
101
102
|
image_folder=image_folder, image_column=meta["image_col"])
|
|
102
103
|
|
|
103
104
|
|
|
104
|
-
def load_split(dataset: str | MulTaBenchDatasetID, fold: int, size: Size =
|
|
105
|
+
def load_split(dataset: str | MulTaBenchDatasetID, fold: int, size: Size = DEFAULT_SIZE,
|
|
105
106
|
data_dir: Optional[str] = None, with_image_files: bool = True) -> DatasetSplit:
|
|
106
107
|
"""The fold's train and test rows, from the Hub or data_dir (see README), with or without the image files."""
|
|
107
108
|
if isinstance(dataset, str):
|
|
@@ -110,7 +111,7 @@ def load_split(dataset: str | MulTaBenchDatasetID, fold: int, size: Size = Size.
|
|
|
110
111
|
return split_dataset(dataset, fold=fold, size=size)
|
|
111
112
|
|
|
112
113
|
|
|
113
|
-
def split_dataset(dataset: MultimodalDataset, fold: int, size: Size =
|
|
114
|
+
def split_dataset(dataset: MultimodalDataset, fold: int, size: Size = DEFAULT_SIZE) -> DatasetSplit:
|
|
114
115
|
train_idx, test_idx = get_split(dataset.y.to_numpy(), is_cls=dataset.is_cls, split=fold, size=size)
|
|
115
116
|
return DatasetSplit(x_train=dataset.x.iloc[train_idx],
|
|
116
117
|
y_train=dataset.y.iloc[train_idx],
|
|
@@ -129,8 +130,9 @@ class SplitEmbeddings:
|
|
|
129
130
|
meta: dict
|
|
130
131
|
|
|
131
132
|
|
|
132
|
-
def load_embeddings(dataset: str | MulTaBenchDatasetID, fold: int, size: Size =
|
|
133
|
-
encoder: str | CachedEncoder =
|
|
133
|
+
def load_embeddings(dataset: str | MulTaBenchDatasetID, fold: int, size: Size = DEFAULT_SIZE,
|
|
134
|
+
encoder: str | CachedEncoder = DEFAULT_TEXT_ENCODER,
|
|
135
|
+
data_dir: Optional[str] = None) -> SplitEmbeddings:
|
|
134
136
|
"""The split's cached embeddings, from the Hub, or from data_dir if given (see README)."""
|
|
135
137
|
if isinstance(dataset, str):
|
|
136
138
|
dataset = MulTaBenchDatasetID[dataset]
|
|
@@ -23,7 +23,10 @@ class Size(StrEnum):
|
|
|
23
23
|
FULL = "full"
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
DEFAULT_SIZE = Size.TEN_K
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_split(y: np.ndarray, is_cls: bool, split: int, size: Size = DEFAULT_SIZE) -> Tuple[np.ndarray, np.ndarray]:
|
|
27
30
|
size = Size(size)
|
|
28
31
|
y = np.asarray(y)
|
|
29
32
|
if is_cls and _smallest_class_count(y) >= FOLDS:
|
|
@@ -10,14 +10,14 @@ from multabench.benchmark.runs import Run
|
|
|
10
10
|
from multabench.benchmark.splits import Size
|
|
11
11
|
from multabench.datasets.all_datasets import Modality, MulTaBenchDatasetID, dataset_modality
|
|
12
12
|
from multabench.dino.constants import ImageEncoder
|
|
13
|
-
from multabench.e5.constants import TextEncoder
|
|
13
|
+
from multabench.e5.constants import DEFAULT_TEXT_ENCODER, TextEncoder
|
|
14
14
|
from multabench.embeddings.hub import CACHED_ENCODERS, download_embeddings, is_tuned
|
|
15
15
|
|
|
16
16
|
SLURM_ARRAY_LIMIT = 1000
|
|
17
17
|
DEFAULT_TEXT_ENCODERS = [TextEncoder.TFIDF, TextEncoder.E5_SMALL, TextEncoder.E5_SMALL_TAR]
|
|
18
18
|
DEFAULT_IMAGE_ENCODERS = [ImageEncoder.DINO_SMALL, ImageEncoder.DINO_SMALL_TAR]
|
|
19
19
|
# Image datasets with text columns vary only the image encoder; their text is embedded with frozen E5.
|
|
20
|
-
IMAGE_TEXT_TEXT_ENCODER =
|
|
20
|
+
IMAGE_TEXT_TEXT_ENCODER = DEFAULT_TEXT_ENCODER
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def select_datasets(names: Optional[List[str]], modalities: Optional[List[Modality]]) -> List[MulTaBenchDatasetID]:
|
|
@@ -14,6 +14,9 @@ class ImageEncoder(StrEnum):
|
|
|
14
14
|
DINO_LARGE = "dino-large"
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
DEFAULT_IMAGE_ENCODER = ImageEncoder.DINO_SMALL
|
|
18
|
+
|
|
19
|
+
|
|
17
20
|
IMAGE_ENCODERS = {
|
|
18
21
|
ImageEncoder.DINO_SMALL: Encoder(encoder_name=DINOV3_SMALL, tune_encoder=False),
|
|
19
22
|
ImageEncoder.DINO_SMALL_TAR: Encoder(encoder_name=DINOV3_SMALL, tune_encoder=True),
|
|
@@ -19,6 +19,9 @@ class TextEncoder(StrEnum):
|
|
|
19
19
|
E5_LARGE = "e5-large"
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
DEFAULT_TEXT_ENCODER = TextEncoder.E5_SMALL
|
|
23
|
+
|
|
24
|
+
|
|
22
25
|
TEXT_ENCODERS = {
|
|
23
26
|
TextEncoder.TFIDF: Encoder(encoder_name=TF_IDF, tune_encoder=False),
|
|
24
27
|
TextEncoder.E5_SMALL: Encoder(encoder_name=E5_SMALL_V2, tune_encoder=False),
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
import sys
|
|
4
4
|
|
|
5
5
|
from multabench.benchmark.load import load_multabench_dataset
|
|
6
|
-
from multabench.benchmark.splits import SPLITS, Size
|
|
6
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, SPLITS, Size
|
|
7
7
|
from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
8
8
|
from multabench.embeddings.compute import compute_embeddings
|
|
9
9
|
from multabench.embeddings.hub import CACHED_ENCODERS, META_JSON, embeds_dataset, is_tuned, parse_encoder
|
|
@@ -16,7 +16,7 @@ if __name__ == "__main__":
|
|
|
16
16
|
parser.add_argument('--encoder', type=parse_encoder, required=True, choices=CACHED_ENCODERS)
|
|
17
17
|
parser.add_argument('--dataset_name', type=str, required=True, choices=[d.name for d in MulTaBenchDatasetID])
|
|
18
18
|
parser.add_argument('--fold', type=int, default=None, choices=range(SPLITS), help="for a tuned encoder")
|
|
19
|
-
parser.add_argument('--size', type=Size, default=
|
|
19
|
+
parser.add_argument('--size', type=Size, default=DEFAULT_SIZE, choices=list(Size), help="for a tuned encoder")
|
|
20
20
|
parser.add_argument('--output_dir', type=str, default='embeddings')
|
|
21
21
|
parser.add_argument('--device', type=str, default=None, help="e.g. cuda:1 or cpu; default: cuda, then mps, then cpu")
|
|
22
22
|
parser.add_argument('--overwrite', action='store_true', default=False)
|
|
@@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|
|
4
4
|
from os.path import join
|
|
5
5
|
from typing import Iterable, List, Optional
|
|
6
6
|
|
|
7
|
-
from multabench.benchmark.splits import SPLITS, Size
|
|
7
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, SPLITS, Size
|
|
8
8
|
from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
9
9
|
from multabench.embeddings.hub import META_JSON, CachedEncoder, embeddings_dir, embeds_dataset, is_tuned, repo_name
|
|
10
10
|
|
|
@@ -27,7 +27,7 @@ class EmbeddingJob:
|
|
|
27
27
|
self.dataset.name, *split, "--output_dir", output_dir])
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def list_jobs(encoders: Iterable[CachedEncoder], datasets: Iterable[MulTaBenchDatasetID], size: Size =
|
|
30
|
+
def list_jobs(encoders: Iterable[CachedEncoder], datasets: Iterable[MulTaBenchDatasetID], size: Size = DEFAULT_SIZE,
|
|
31
31
|
folds: Iterable[int] = range(SPLITS)) -> List[EmbeddingJob]:
|
|
32
32
|
folds = list(folds)
|
|
33
33
|
return [job for encoder in encoders for dataset in datasets if embeds_dataset(encoder, dataset)
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import pandas as pd
|
|
3
3
|
|
|
4
4
|
from multabench.benchmark.collect import RESULT_COLUMNS
|
|
5
|
-
from multabench.benchmark.splits import Size
|
|
5
|
+
from multabench.benchmark.splits import DEFAULT_SIZE, Size
|
|
6
6
|
from multabench.leaderboard.elo import load_runs
|
|
7
7
|
from multabench.result_keys import ResultKey
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def load_published_results(size: Size | str =
|
|
10
|
+
def load_published_results(size: Size | str = DEFAULT_SIZE) -> pd.DataFrame:
|
|
11
11
|
"""Every published run of that size, failed runs included, in the collect_results columns."""
|
|
12
12
|
runs = load_runs()
|
|
13
13
|
return runs[runs[ResultKey.SIZE] == Size(size)].reindex(columns=RESULT_COLUMNS).reset_index(drop=True)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multabench
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: Benchmarking multimodal tabular learning: tables whose columns include text or images
|
|
5
5
|
Author: Alan Arazi, Eilam Shapira, Shoham Grunblat, Mor Ventura, Elad Hoffer, Gioia Blayer, David Holzmüller, Lennart Purucker, Gaël Varoquaux, Frank Hutter, Roi Reichart
|
|
6
6
|
License-Expression: MIT
|
|
@@ -6,10 +6,11 @@ BENCH_ONLY = ["torch", "torchvision", "transformers", "peft", "PIL", "skrub", "a
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def test_the_core_imports_no_bench_package():
|
|
9
|
-
code = ("import sys, multabench; from multabench import (DATA_PARQUET,
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
9
|
+
code = ("import sys, multabench; from multabench import (DATA_PARQUET, DEFAULT_IMAGE_ENCODER, DEFAULT_SIZE, "
|
|
10
|
+
"DEFAULT_TEXT_ENCODER, EMBEDDINGS_NPZ, FOLDS, META_JSON, METADATA_JSON, REPEATS, SPLITS, CachedEncoder, "
|
|
11
|
+
"DatasetInfo, Modality, MulTaBenchDatasetID, Score, Size, SupervisedTask, Tier, data_dir_files, "
|
|
12
|
+
"embeddings_repo_id, embeds_dataset, hf_repo_id, list_datasets, load_embeddings, load_published_results, "
|
|
13
|
+
"load_split, parse_encoder, repo_name, revision, score); "
|
|
13
14
|
f"print([m for m in {BENCH_ONLY} if m in sys.modules])")
|
|
14
15
|
out = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, check=True).stdout
|
|
15
16
|
assert out.strip() == "[]"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|