-
Notifications
You must be signed in to change notification settings - Fork 12
/
nondeterminism.py
55 lines (46 loc) · 2.22 KB
/
nondeterminism.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from eureka_ml_insights.data_utils import (
ColumnRename,
MultiplyTransform,
SamplerTransform,
SequenceTransform,
)
from .geometer import GEOMETER_PIPELINE
from .ifeval import IFEval_PIPELINE
from .kitab import KITAB_ONE_BOOK_CONSTRAINT_PIPELINE
from .mmmu import MMMU_BASELINE_PIPELINE
class IFEval_Nondeterminism(IFEval_PIPELINE):
def configure_pipeline(self, **kwargs):
config = super().configure_pipeline(**kwargs)
# Downsample the data and repeat each prompt 3 time
self.data_processing_comp.data_reader_config.init_args["transform"] = SequenceTransform(
[SamplerTransform(random_seed=99, sample_count=150), MultiplyTransform(n_repeats=3)]
)
return config
class Geo_Nondeterminism(GEOMETER_PIPELINE):
def configure_pipeline(self, **kwargs):
config = super().configure_pipeline(**kwargs)
# Downsample the data and repeat each prompt 3 time
config.component_configs[0].data_reader_config.init_args["transform"].transforms.extend(
[SamplerTransform(random_seed=42, sample_count=75, stratify_by="category"), MultiplyTransform(n_repeats=3)]
)
return config
class Kitab_Nondeterminism(KITAB_ONE_BOOK_CONSTRAINT_PIPELINE):
def configure_pipeline(self, **kwargs):
config = super().configure_pipeline(**kwargs)
# Downsample the data and repeat each prompt 3 time
config.component_configs[0].data_reader_config.init_args["transform"] = SequenceTransform(
[
ColumnRename(name_mapping={"Author": "author", "Birth Year": "birth_year"}),
SamplerTransform(random_seed=99, sample_count=20, stratify_by="constraint_type"),
MultiplyTransform(n_repeats=3),
]
)
return config
class MMMU_Nondeterminism(MMMU_BASELINE_PIPELINE):
def configure_pipeline(self, **kwargs):
config = super().configure_pipeline(**kwargs)
# Downsample the data and repeat each prompt 3 time
self.data_processing_comp.data_reader_config.init_args["transform"].transforms.extend(
[SamplerTransform(random_seed=42, sample_count=5, stratify_by="__hf_task"), MultiplyTransform(n_repeats=3)]
)
return config