[Update] Update dataset configs (#2030)

* [Update] Update dataset configs

* Fix lint
This commit is contained in:
Linchen Xiao 2025-04-21 18:55:06 +08:00 committed by GitHub
parent c69110361b
commit 455bb05d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 2 deletions

View File

@ -86,7 +86,7 @@ for _name in chembench_all_sets:
),
dataset_cfg=dict(
type=ChemBenchDataset,
path='/fs-computility/llm/xiaolinchen/opencompass_fork/data/ChemBench4K',
path='opencompass/ChemBench4K',
name=_name,
reader_cfg=chembench_reader_cfg,
),

View File

@ -33,7 +33,12 @@ def extract_theoremqa_answer(pred: str, answer_flag: bool = True):
try:
with time_limit(1):
tmp = str(latex2sympy(pred))
pred = str(eval(tmp))
pred = eval(tmp)
if isinstance(pred, tuple):
pred = str(list(pred))
else:
pred = str(pred)
except Exception:
if re.match(r'-?[\d\.]+\s\D+$', pred):
pred = pred.split(' ')[0]

View File

@ -14,6 +14,7 @@ from opencompass.utils import get_data_path
from ..base import BaseDataset
@LOAD_DATASET.register_module()
class RewardBenchDataset(BaseDataset):

View File

@ -4,6 +4,7 @@ from collections import defaultdict
import numpy as np
from datasets import Dataset, DatasetDict, load_dataset
from nltk.translate.meteor_score import meteor_score
from opencompass.openicl.icl_evaluator.icl_base_evaluator import BaseEvaluator
from opencompass.registry import (ICL_EVALUATORS, LOAD_DATASET,