Skip to content

Commit cad0343

Browse files
[Dataset] add dataset LCB_pro (open-compass#2361)
* add lcb_pro * fix lint
1 parent 8151d97 commit cad0343

File tree

5 files changed

+518
-1
lines changed

5 files changed

+518
-1
lines changed

opencompass/configs/datasets/livecodebench/livecodebench_pro_gen.py renamed to opencompass/configs/datasets/livecodebench_pro/livecodebench_pro_gen.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from opencompass.openicl.icl_inferencer import GenInferencer
44
from opencompass.datasets import (
55
LCBProDataset,
6+
LCBProEvaluator,
67
)
78

89
lcb_pro_reader_cfg = dict(
@@ -29,7 +30,14 @@
2930
)
3031

3132
lcb_pro_eval_cfg = dict(
32-
evaluator=dict()
33+
evaluator=dict(
34+
type=LCBProEvaluator,
35+
submit_url='http://lightcpverifier.ailab.ailab.ai/submit',
36+
result_url='http://lightcpverifier.ailab.ailab.ai/result/{submission_id}',
37+
timeout=10,
38+
poll_interval=10,
39+
max_retries=3,
40+
)
3341
)
3442

3543
lcb_pro_datasets = [

opencompass/datasets/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
from .lcsts import * # noqa: F401, F403
9494
from .leval import * # noqa: F401, F403
9595
from .livecodebench import * # noqa: F401, F403
96+
from .livecodebench_pro import * # noqa: F401, F403
9697
from .livemathbench import * # noqa: F401, F403
9798
from .livereasonbench import * # noqa: F401, F403
9899
from .livestembench import * # noqa: F401, F403
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .livecodebench_pro import LCBProDataset # noqa: F401, F403
2+
from .livecodebench_pro_evaluator import LCBProEvaluator # noqa: F401, F403
3+
4+
__all__ = ['LCBProDataset', 'LCBProEvaluator']
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import json
2+
3+
from datasets import Dataset
4+
5+
from opencompass.utils import get_data_path # noqa: F401, F403
6+
7+
from ..base import BaseDataset
8+
9+
10+
class LCBProDataset(BaseDataset):
11+
12+
@staticmethod
13+
def load(path, **kwargs):
14+
path = get_data_path(path)
15+
dataset_list = []
16+
li = 0
17+
with open(path, 'r', encoding='utf-8') as f:
18+
for line in f:
19+
line = line.strip()
20+
data = json.loads(line)
21+
dataset_list.append({
22+
'id_ddm': data['id_ddm'],
23+
'problem': data['dialogs'][0]['content']
24+
})
25+
li += 1
26+
return Dataset.from_list(dataset_list)

0 commit comments

Comments
 (0)