-
Notifications
You must be signed in to change notification settings - Fork 0
/
light_scenario.py
60 lines (41 loc) · 1.05 KB
/
light_scenario.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
56
57
58
59
60
from dataclasses import dataclass
from typing import List, Optional
try:
from scenarios.scenario import ScenarioSpec
except Exception:
from helm.benchmark.scenarios.scenario import ScenarioSpec
@dataclass(frozen=True)
class LightInstance:
"""
A lighter `Instance` with only text fields.
"""
input: str
"""The input"""
references: List[str]
"""References that help us evaluate"""
id: Optional[str] = None
"""Helm instance id"""
@dataclass(frozen=True)
class LightScenarioKey:
"""
Key for LightScenario
"""
scenario_spec: ScenarioSpec
split: str
def __hash__(self):
return hash((self.scenario_spec, self.split))
@dataclass(frozen=True)
class LightScenario:
"""
A lighter `Scenario`.
"""
scenario_key: LightScenarioKey
instances: List[LightInstance]
"""Instances of this scenario"""
@dataclass(frozen=True)
class ScenarioSpecInstanceIds:
"""
Instance ids associated with a scenario
"""
scenario_spec: ScenarioSpec
instance_ids: List[str]