Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"eval": {
"task": "text-classification",
"dataset": {
"path": "tweet_eval",
"path": "cardiffnlp/tweet_eval",
"name": "sentiment",
"samples": 100,
"columns_mapping": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"eval": {
"task": "text-classification",
"dataset": {
"path": "tweet_eval",
"path": "cardiffnlp/tweet_eval",
"name": "sentiment",
"samples": 1000,
"columns_mapping": {
Expand Down
8 changes: 4 additions & 4 deletions scripts/e2e_eval/cache/baseline_cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"elapsed": 59.2,
"command": "python.exe run_pytorch_baseline.py --model finbert --task text-classification --device cpu --num-samples 1000 --dataset finbert_dataset --split val"
},
"cardiffnlp/twitter-roberta-base-sentiment-latest|text-classification|tweet_eval|sentiment||1000": {
"cardiffnlp/twitter-roberta-base-sentiment-latest|text-classification|cardiffnlp/tweet_eval|sentiment||1000": {
"status": "PASS",
"metric": {
"metric": "accuracy",
"value": 0.769,
"num_samples": 1000
},
"elapsed": 91.5,
"command": "python.exe run_pytorch_baseline.py --model twitter-roberta-base-sentiment-latest --task text-classification --device cpu --num-samples 1000 --dataset tweet_eval --dataset-config sentiment --columns-mapping {\"input_column\": \"text\"}"
"command": "python.exe run_pytorch_baseline.py --model twitter-roberta-base-sentiment-latest --task text-classification --device cpu --num-samples 1000 --dataset cardiffnlp/tweet_eval --dataset-config sentiment --columns-mapping {\"input_column\": \"text\"}"
},
"distilbert/distilbert-base-uncased-finetuned-sst-2-english|text-classification|nyu-mll/glue|sst2||1000": {
"status": "PASS",
Expand Down Expand Up @@ -959,15 +959,15 @@
"elapsed": 52.0,
"command": "python.exe run_pytorch_baseline.py --model finbert --task text-classification --device cpu --num-samples 100 --dataset finbert_dataset --split val --winml-metric-key accuracy"
},
"cardiffnlp/twitter-roberta-base-sentiment-latest|text-classification|tweet_eval|sentiment||100": {
"cardiffnlp/twitter-roberta-base-sentiment-latest|text-classification|cardiffnlp/tweet_eval|sentiment||100": {
"status": "PASS",
"metric": {
"metric": "accuracy",
"value": 0.81,
"num_samples": 100
},
"elapsed": 54.9,
"command": "python.exe run_pytorch_baseline.py --model twitter-roberta-base-sentiment-latest --task text-classification --device cpu --num-samples 100 --dataset tweet_eval --dataset-config sentiment --columns-mapping {\"input_column\": \"text\"} --winml-metric-key accuracy"
"command": "python.exe run_pytorch_baseline.py --model twitter-roberta-base-sentiment-latest --task text-classification --device cpu --num-samples 100 --dataset cardiffnlp/tweet_eval --dataset-config sentiment --columns-mapping {\"input_column\": \"text\"} --winml-metric-key accuracy"
},
"distilbert/distilbert-base-uncased-finetuned-sst-2-english|text-classification|nyu-mll/glue|sst2||100": {
"status": "PASS",
Expand Down
2 changes: 1 addition & 1 deletion scripts/e2e_eval/testsets/models_with_acc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"group": "Top200",
"priority": "P1",
"dataset_config": {
"path": "tweet_eval",
"path": "cardiffnlp/tweet_eval",
"name": "sentiment",
"metric": "accuracy",
"columns_mapping": {
Expand Down
2 changes: 1 addition & 1 deletion src/winml/modelkit/commands/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"dataset_path",
type=str,
default=None,
help="HF dataset path (e.g. 'imagenet-1k', 'glue'). "
help="HF dataset path (e.g. 'imagenet-1k', 'nyu-mll/glue'). "
"If omitted, uses a default dataset for the task.",
)
@click.option(
Expand Down
11 changes: 8 additions & 3 deletions src/winml/modelkit/datasets/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

logger = logging.getLogger(__name__)

# HF requires fully qualified repository ids ("namespace/name"); the legacy
# canonical alias "glue" is no longer resolvable.
DEFAULT_TEXT_DATASET = "nyu-mll/glue"
DEFAULT_TEXT_DATASET_SUBSET = "mrpc"


class TextDataset(BaseTaskDataset):
"""Dataset for text tasks with universal tokenization.
Expand Down Expand Up @@ -56,7 +61,7 @@ def __init__(

Args:
model_name: HuggingFace model identifier
dataset_name: Dataset name (default: glue)
dataset_name: Dataset name (default: nyu-mll/glue)
max_samples: Maximum samples (None = use all)
data_split: Dataset split (default: train)
max_length: Sequence length (default: from io_config or 128)
Expand Down Expand Up @@ -85,8 +90,8 @@ def __init__(
def _get_default_dataset(self) -> None:
"""Set default dataset if none specified."""
if self._dataset_name is None:
self._dataset_name = "glue"
self._config["subset"] = self._config.get("subset", "mrpc")
self._dataset_name = DEFAULT_TEXT_DATASET
self._config["subset"] = self._config.get("subset", DEFAULT_TEXT_DATASET_SUBSET)
self._data_split = self._data_split or "train"

def _resolve_max_length(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/winml/modelkit/eval/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DatasetConfig:
"""Dataset configuration, aligned with HF load_dataset() API.

Attributes:
path: HF dataset path (e.g., "imagenet-1k", "glue").
path: HF dataset path (e.g., "imagenet-1k", "nyu-mll/glue").
name: Config name for multi-config datasets (e.g., "mrpc").
split: Dataset split.
samples: Number of samples to evaluate.
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/datasets/test_text_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def test_default_seq_len_constant(self):
assert TextDataset.DEFAULT_SEQ_LEN == 128

def test_default_dataset_glue_mrpc(self):
"""Test default dataset is glue/mrpc when none specified."""
"""Test default dataset is nyu-mll/glue with the mrpc subset."""
from winml.modelkit.datasets import TextDataset

dataset = TextDataset(
model_name="bert-base-uncased",
max_samples=5,
)

assert dataset.dataset_name == "glue"
assert dataset.dataset_name == "nyu-mll/glue"
assert dataset.data_split == "train"

def test_explicit_dataset_name(self):
Expand All @@ -61,13 +61,13 @@ def test_explicit_dataset_name(self):

dataset = TextDataset(
model_name="bert-base-uncased",
dataset_name="glue",
dataset_name="nyu-mll/glue",
data_split="validation",
max_samples=5,
subset="sst2",
)

assert dataset.dataset_name == "glue"
assert dataset.dataset_name == "nyu-mll/glue"
assert dataset.data_split == "validation"

def test_max_samples_limits_dataset_size(self):
Expand Down Expand Up @@ -274,7 +274,7 @@ def test_single_sentence_detection_sst2(self):
# GLUE/SST2 is a single sentence task
dataset = TextDataset(
model_name="bert-base-uncased",
dataset_name="glue",
dataset_name="nyu-mll/glue",
data_split="train",
max_samples=5,
subset="sst2",
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/eval/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def _fake_compute(**kw):
model_id="test/model",
task="text-classification",
dataset=DatasetConfig(
path="glue",
path="nyu-mll/glue",
name="mrpc",
columns_mapping={"input_column": "sentence1", "second_input_column": "sentence2"},
),
Expand Down Expand Up @@ -803,7 +803,7 @@ def test_sets_padding_for_text_model(
config = WinMLEvaluationConfig(
model_id="test/model",
task="text-classification",
dataset=DatasetConfig(path="glue", name="mrpc"),
dataset=DatasetConfig(path="nyu-mll/glue", name="mrpc"),
)

WinMLTextClassificationEvaluator(config, model).compute()
Expand Down Expand Up @@ -847,7 +847,7 @@ def test_no_padding_without_tokenizer(
config = WinMLEvaluationConfig(
model_id="test/model",
task="text-classification",
dataset=DatasetConfig(path="glue"),
dataset=DatasetConfig(path="nyu-mll/glue"),
)

WinMLTextClassificationEvaluator(config, model).compute()
Expand Down
Loading