multabench 0.0.4__tar.gz → 0.0.5__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.4 → multabench-0.0.5}/PKG-INFO +2 -1
- {multabench-0.0.4 → multabench-0.0.5}/README.md +1 -0
- multabench-0.0.5/multabench/__init__.py +12 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/load.py +23 -4
- {multabench-0.0.4 → multabench-0.0.5}/multabench.egg-info/PKG-INFO +2 -1
- {multabench-0.0.4 → multabench-0.0.5}/pyproject.toml +1 -1
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_core_imports.py +4 -2
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_local_data_dir.py +25 -2
- multabench-0.0.4/multabench/__init__.py +0 -7
- {multabench-0.0.4 → multabench-0.0.5}/LICENSE +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/abstract_model.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/autogluon_mm.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/benchmarks/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/benchmarks/evaluate.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/catboost.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/causilo.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/contexttab.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/exaone_tabular.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/kumo_tabular.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/lgbm.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/limix2.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/mitra2.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/categorical.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/column_encoders.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/dates.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/feature_types.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/image_embeddings.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/nulls.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/numerical.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/target.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/text_embeddings.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/validation.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/random_forest.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/realmlp.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabdpt.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabdpt13.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabfm.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabicl_v2.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabldm.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabm.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabpfn.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabstar_v1.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/tabstar_v1p1.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/training/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/training/metrics.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/xgboost.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/collect.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/metrics.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/runs.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/splits.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/sweep.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/utils/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/utils/constants.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/benchmark/utils/curation.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/constants.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/all_datasets.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/hub.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/info.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/objects.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/revisions.json +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/datasets/revisions.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/dino/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/dino/constants.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/dino/dino_finetune.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/dino/image_loading.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/e5/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/e5/constants.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/e5/e5_finetune.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/compute.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/embed.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/embed_sweep.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/hub.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/embeddings/jobs.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/finetune/lora.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/finetune/train_args.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/finetune/utils.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/elo.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/embedding_cost.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/export.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/CatBoost.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Causilo.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/ConTextTab.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/EXAONE-Tabular.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Kumo-Tabular-Medium.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Kumo-Tabular-Small.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Kumo-Tabular.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/LightGBM.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/LimiX-2.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Mitra-v2.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/RandomForest.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/RealMLP.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabDPT-1.3.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabDPT.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabFM.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabICLv2.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabM.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabPFN-3.5-Fast.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabPFN-3.5.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabPFN-3.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabPFN-v2.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabPFN-v2p5.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabSTAR-v1.1.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/TabSTAR.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/XGBoost.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/models/Xiaomi-TabLDM.csv +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/leaderboard/published.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/preprocessing/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/preprocessing/discretize.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/preprocessing/splits.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/result_keys.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/__init__.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/devices.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/encoders.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/hardware.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/logging.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/profiling.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/timing.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench/utils/warnings.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench.egg-info/SOURCES.txt +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench.egg-info/dependency_links.txt +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench.egg-info/requires.txt +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/multabench.egg-info/top_level.txt +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/setup.cfg +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_collect.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_datasets_info.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_elo.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_embeddings.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_feature_types.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_hardware.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_hub.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_leaderboard_results.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_metrics.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_official_commit.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_profiling.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_published_results.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_registry.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_space_data.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_splits.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_sweep.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_tabstar_mapping.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_text_embeddings.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/tests/test_timing.py +0 -0
- {multabench-0.0.4 → multabench-0.0.5}/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.5
|
|
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
|
|
@@ -122,6 +122,7 @@ result.test_error
|
|
|
122
122
|
The loaders download from the Hugging Face Hub at pinned revisions. To read a local copy instead, e.g. offline or from
|
|
123
123
|
a read-only mount, pass `data_dir`, holding one folder per Hub repo named without the org, with images extracted:
|
|
124
124
|
`<data_dir>/<dataset repo>/data.parquet` and `<data_dir>/embeddings-e5-small/<dataset repo>/embeddings.npz`.
|
|
125
|
+
`data_dir_files(dataset, encoders)` lists the paths one dataset needs there.
|
|
125
126
|
|
|
126
127
|
```python
|
|
127
128
|
split = load_split("MUL_IMAGE_PETFINDER", fold=0, data_dir="/data/multabench")
|
|
@@ -63,6 +63,7 @@ result.test_error
|
|
|
63
63
|
The loaders download from the Hugging Face Hub at pinned revisions. To read a local copy instead, e.g. offline or from
|
|
64
64
|
a read-only mount, pass `data_dir`, holding one folder per Hub repo named without the org, with images extracted:
|
|
65
65
|
`<data_dir>/<dataset repo>/data.parquet` and `<data_dir>/embeddings-e5-small/<dataset repo>/embeddings.npz`.
|
|
66
|
+
`data_dir_files(dataset, encoders)` lists the paths one dataset needs there.
|
|
66
67
|
|
|
67
68
|
```python
|
|
68
69
|
split = load_split("MUL_IMAGE_PETFINDER", fold=0, data_dir="/data/multabench")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from multabench.benchmark.load import data_dir_files, load_embeddings, load_split
|
|
2
|
+
from multabench.benchmark.metrics import Score, score
|
|
3
|
+
from multabench.benchmark.splits import FOLDS, REPEATS, SPLITS, Size
|
|
4
|
+
from multabench.benchmark.utils.constants import METADATA_JSON
|
|
5
|
+
from multabench.datasets.all_datasets import Modality, MulTaBenchDatasetID
|
|
6
|
+
from multabench.datasets.hub import DATA_PARQUET, hf_repo_id
|
|
7
|
+
from multabench.datasets.info import DatasetInfo, Tier, list_datasets
|
|
8
|
+
from multabench.datasets.objects import SupervisedTask
|
|
9
|
+
from multabench.datasets.revisions import revision
|
|
10
|
+
from multabench.embeddings.hub import (EMBEDDINGS_NPZ, META_JSON, CachedEncoder, embeddings_repo_id, embeds_dataset,
|
|
11
|
+
parse_encoder, repo_name)
|
|
12
|
+
from multabench.leaderboard.published import load_published_results
|
|
@@ -12,19 +12,20 @@ Usage:
|
|
|
12
12
|
import json
|
|
13
13
|
from dataclasses import dataclass
|
|
14
14
|
from os.path import join
|
|
15
|
-
from typing import Dict, List, Optional
|
|
15
|
+
from typing import Dict, List, Optional, Sequence
|
|
16
16
|
|
|
17
17
|
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 Size, get_split
|
|
21
|
+
from multabench.benchmark.splits import 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.embeddings.hub import (
|
|
27
|
-
|
|
26
|
+
from multabench.embeddings.hub import (CACHED_ENCODERS, EMBEDDINGS_NPZ, META_JSON, CachedEmbeddings, CachedEncoder,
|
|
27
|
+
download_embeddings, embeddings_dir, embeds_dataset, encoder_inputs,
|
|
28
|
+
input_values, is_tuned, parse_encoder, read_embeddings, repo_name)
|
|
28
29
|
from multabench.benchmark.utils.constants import METADATA_JSON
|
|
29
30
|
from multabench.benchmark.utils.curation import TASK_REG, task_type_from_name
|
|
30
31
|
|
|
@@ -59,6 +60,24 @@ def download_dataset(dataset_id: MulTaBenchDatasetID, data_dir: Optional[str] =
|
|
|
59
60
|
return dir_path
|
|
60
61
|
|
|
61
62
|
|
|
63
|
+
def data_dir_files(dataset: str | MulTaBenchDatasetID, encoders: Sequence[str | CachedEncoder] = CACHED_ENCODERS,
|
|
64
|
+
size: Size = Size.TEN_K, with_image_files: bool = True) -> List[str]:
|
|
65
|
+
"""The paths, relative to a data_dir, that the dataset's splits and its cached embeddings by each encoder read."""
|
|
66
|
+
if isinstance(dataset, str):
|
|
67
|
+
dataset = MulTaBenchDatasetID[dataset]
|
|
68
|
+
table = hf_repo_id(dataset).split("/")[-1]
|
|
69
|
+
paths = [join(table, DATA_PARQUET), join(table, METADATA_JSON)]
|
|
70
|
+
if with_image_files and _has_images(dataset):
|
|
71
|
+
paths.append(join(table, IMAGES_DIR))
|
|
72
|
+
for encoder in map(parse_encoder, encoders):
|
|
73
|
+
if not embeds_dataset(encoder, dataset):
|
|
74
|
+
continue
|
|
75
|
+
folds = [dict(size=size, fold=k) for k in range(SPLITS)] if is_tuned(encoder) else [{}]
|
|
76
|
+
paths += [join(repo_name(encoder), embeddings_dir(dataset, **fold), f)
|
|
77
|
+
for fold in folds for f in (EMBEDDINGS_NPZ, META_JSON)]
|
|
78
|
+
return paths
|
|
79
|
+
|
|
80
|
+
|
|
62
81
|
def _has_images(dataset_id: MulTaBenchDatasetID) -> bool:
|
|
63
82
|
return dataset_modality(dataset_id) != Modality.TEXT
|
|
64
83
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: multabench
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
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
|
|
@@ -122,6 +122,7 @@ result.test_error
|
|
|
122
122
|
The loaders download from the Hugging Face Hub at pinned revisions. To read a local copy instead, e.g. offline or from
|
|
123
123
|
a read-only mount, pass `data_dir`, holding one folder per Hub repo named without the org, with images extracted:
|
|
124
124
|
`<data_dir>/<dataset repo>/data.parquet` and `<data_dir>/embeddings-e5-small/<dataset repo>/embeddings.npz`.
|
|
125
|
+
`data_dir_files(dataset, encoders)` lists the paths one dataset needs there.
|
|
125
126
|
|
|
126
127
|
```python
|
|
127
128
|
split = load_split("MUL_IMAGE_PETFINDER", fold=0, data_dir="/data/multabench")
|
|
@@ -6,8 +6,10 @@ 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 (
|
|
10
|
-
"
|
|
9
|
+
code = ("import sys, multabench; from multabench import (DATA_PARQUET, EMBEDDINGS_NPZ, FOLDS, META_JSON, "
|
|
10
|
+
"METADATA_JSON, REPEATS, SPLITS, CachedEncoder, DatasetInfo, Modality, MulTaBenchDatasetID, Score, Size, "
|
|
11
|
+
"SupervisedTask, Tier, data_dir_files, embeddings_repo_id, embeds_dataset, hf_repo_id, list_datasets, "
|
|
12
|
+
"load_embeddings, load_published_results, load_split, parse_encoder, repo_name, revision, score); "
|
|
11
13
|
f"print([m for m in {BENCH_ONLY} if m in sys.modules])")
|
|
12
14
|
out = subprocess.run([sys.executable, "-c", code], capture_output=True, text=True, check=True).stdout
|
|
13
15
|
assert out.strip() == "[]"
|
|
@@ -8,8 +8,8 @@ import pandas as pd
|
|
|
8
8
|
import pytest
|
|
9
9
|
|
|
10
10
|
from multabench.benchmark import load
|
|
11
|
-
from multabench.benchmark.load import load_embeddings, load_split, load_target
|
|
12
|
-
from multabench.benchmark.splits import Size
|
|
11
|
+
from multabench.benchmark.load import data_dir_files, load_embeddings, load_split, load_target
|
|
12
|
+
from multabench.benchmark.splits import SPLITS, Size
|
|
13
13
|
from multabench.datasets.all_datasets import MulTaBenchDatasetID
|
|
14
14
|
from multabench.dino.constants import ImageEncoder
|
|
15
15
|
from multabench.e5.constants import TextEncoder
|
|
@@ -148,3 +148,26 @@ def test_an_image_dataset_loads_without_its_images(monkeypatch, tmp_path):
|
|
|
148
148
|
load_split(IMAGE, fold=0, data_dir=without)
|
|
149
149
|
embeddings = load_embeddings(IMAGE, fold=0, encoder="dino-small", data_dir=without)
|
|
150
150
|
assert embeddings.train["img"].shape == (len(split.x_train), 4)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _files(data_dir):
|
|
154
|
+
return sorted(os.path.relpath(join(root, f), data_dir) for root, dirs, files in os.walk(data_dir) for f in files)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def test_data_dir_files_lists_what_the_loaders_read(monkeypatch, tmp_path):
|
|
158
|
+
_no_hub(monkeypatch)
|
|
159
|
+
data_dir = str(tmp_path)
|
|
160
|
+
x = _write_dataset(data_dir)
|
|
161
|
+
_write_embeddings(data_dir, x, TextEncoder.E5_SMALL)
|
|
162
|
+
for fold in range(SPLITS):
|
|
163
|
+
_write_embeddings(data_dir, x, TextEncoder.E5_SMALL_TAR, size=Size.TEN_K, fold=fold)
|
|
164
|
+
load_embeddings(TEXT, fold=fold, encoder="e5-small-tar", data_dir=data_dir)
|
|
165
|
+
assert sorted(data_dir_files(TEXT.name, encoders=["e5-small", "e5-small-tar"])) == _files(data_dir)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def test_data_dir_files_skips_encoders_the_dataset_does_not_use():
|
|
169
|
+
files = data_dir_files(IMAGE, encoders=["e5-small-tar", "dino-small"])
|
|
170
|
+
assert files == [join(IMAGE.value, "data.parquet"), join(IMAGE.value, "metadata.json"), join(IMAGE.value, "images"),
|
|
171
|
+
join("embeddings-dino-small", IMAGE.value, "embeddings.npz"),
|
|
172
|
+
join("embeddings-dino-small", IMAGE.value, "meta.json")]
|
|
173
|
+
assert join(IMAGE.value, "images") not in data_dir_files(IMAGE, encoders=[], with_image_files=False)
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
from multabench.benchmark.load import load_embeddings, load_split
|
|
2
|
-
from multabench.benchmark.metrics import Score, score
|
|
3
|
-
from multabench.benchmark.splits import Size
|
|
4
|
-
from multabench.datasets.all_datasets import Modality
|
|
5
|
-
from multabench.datasets.info import DatasetInfo, Tier, list_datasets
|
|
6
|
-
from multabench.datasets.objects import SupervisedTask
|
|
7
|
-
from multabench.leaderboard.published import load_published_results
|
|
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
|
{multabench-0.0.4 → multabench-0.0.5}/multabench/baselines/preprocessing/image_embeddings.py
RENAMED
|
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
|