@@ -43,7 +43,7 @@ def dummy_prompt_fc(line, task_name: str = ""):
4343
4444
4545def get_pmi_task (metrics : list [Metric ]):
46- return LightevalTaskConfig (
46+ config = LightevalTaskConfig (
4747 name = "pmi_test_task" ,
4848 metrics = metrics ,
4949 suite = ["test" ],
@@ -52,6 +52,10 @@ def get_pmi_task(metrics: list[Metric]):
5252 hf_subset = xstory_cloze_en_lighteval .hf_subset ,
5353 evaluation_splits = xstory_cloze_en_lighteval .evaluation_splits ,
5454 )
55+ # This is manually edited when updating the config and in the post init function
56+ # - we need to get a more homogeneous system for naming...
57+ config .full_name = "test|pmi_test_task|0"
58+ return config
5559
5660
5761def test_pmi_request ():
@@ -72,9 +76,10 @@ def test_pmi_request():
7276 metric = LogLikelihoodAccMetric (normalization = LogProbPMINorm ())
7377 pmi_test_config = get_pmi_task (metrics = [metric ])
7478 task = LightevalTask (pmi_test_config )
75- result = fake_evaluate_task (task , fake_model , max_samples = 1 )["results" ]["test:pmi_test_task:0" ]
79+ evaluation = fake_evaluate_task (task , fake_model , max_samples = 1 )
80+ results = evaluation ["results" ]["test:pmi_test_task:0" ]
7681 # Correct choice after norm should be the second one so 0 acc
77- assert result [metric .metric_name ] == 0
82+ assert results [metric .metric_name ] == 0
7883
7984
8085def test_pmi_request_with_logprob_metric ():
0 commit comments