facat commited on
Commit
76eab85
1 Parent(s): d13c0d8

fix dataset in task

Browse files
Files changed (2) hide show
  1. tasks.py +7 -5
  2. tlem.py +0 -3
tasks.py CHANGED
@@ -76,8 +76,9 @@ class Task:
76
 
77
  self.name = "-".join(names) + f"-{self.split}"
78
  if isinstance(self.prompt, str):
 
79
  self.prompt = lambda example: {
80
- self.input_column: self.prompt.format(
81
  input_column=example[self.input_column]
82
  )
83
  }
@@ -89,11 +90,12 @@ class Task:
89
 
90
  @cached_property
91
  def dataset(self):
92
- ds = load_dataset(
93
- *self.dataset_name
 
 
94
  if isinstance(self.dataset_name, tuple)
95
- else self.dataset_name,
96
- # split=self.split,
97
  )
98
  test_ds = ds[self.split]
99
  if self.prompt is not None:
 
76
 
77
  self.name = "-".join(names) + f"-{self.split}"
78
  if isinstance(self.prompt, str):
79
+ prompt_format = self.prompt
80
  self.prompt = lambda example: {
81
+ self.input_column: prompt_format.format(
82
  input_column=example[self.input_column]
83
  )
84
  }
 
90
 
91
  @cached_property
92
  def dataset(self):
93
+ ds = (
94
+ load_dataset(
95
+ *self.dataset_name,
96
+ )
97
  if isinstance(self.dataset_name, tuple)
98
+ else load_dataset(self.dataset_name)
 
99
  )
100
  test_ds = ds[self.split]
101
  if self.prompt is not None:
tlem.py CHANGED
@@ -144,9 +144,6 @@ class Suite(EvaluationSuite):
144
  input_column="problem",
145
  label_column="solution",
146
  )
147
- match name:
148
- case _ if "test" in name:
149
- suite = suite["Test"]
150
 
151
  self.suite = [suite] if isinstance(suite, Task) else suite
152
 
 
144
  input_column="problem",
145
  label_column="solution",
146
  )
 
 
 
147
 
148
  self.suite = [suite] if isinstance(suite, Task) else suite
149