From 3f7a3730d740aaf04a330833bc472069a856304a Mon Sep 17 00:00:00 2001 From: bittersweet1999 <148421775+bittersweet1999@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:34:59 +0800 Subject: [PATCH] [Fix] fix Flames (#1599) * fix pip version * fix pip version * fix flames * fix flames --- configs/datasets/{ => subjective}/flames/README.md | 0 configs/datasets/{ => subjective}/flames/flames_gen.py | 0 .../datasets/{ => subjective}/flames/flames_gen_1a58bb.py | 3 ++- .../configs/datasets/{ => subjective}/flames/README.md | 0 .../datasets/{ => subjective}/flames/flames_gen.py | 0 .../datasets/{ => subjective}/flames/flames_gen_1a58bb.py | 3 ++- opencompass/datasets/__init__.py | 1 - opencompass/datasets/subjective/__init__.py | 1 + opencompass/datasets/{ => subjective}/flames.py | 8 ++------ opencompass/summarizers/subjective/flames.py | 2 +- 10 files changed, 8 insertions(+), 10 deletions(-) rename configs/datasets/{ => subjective}/flames/README.md (100%) rename configs/datasets/{ => subjective}/flames/flames_gen.py (100%) rename configs/datasets/{ => subjective}/flames/flames_gen_1a58bb.py (96%) rename opencompass/configs/datasets/{ => subjective}/flames/README.md (100%) rename opencompass/configs/datasets/{ => subjective}/flames/flames_gen.py (100%) rename opencompass/configs/datasets/{ => subjective}/flames/flames_gen_1a58bb.py (96%) rename opencompass/datasets/{ => subjective}/flames.py (92%) diff --git a/configs/datasets/flames/README.md b/configs/datasets/subjective/flames/README.md similarity index 100% rename from configs/datasets/flames/README.md rename to configs/datasets/subjective/flames/README.md diff --git a/configs/datasets/flames/flames_gen.py b/configs/datasets/subjective/flames/flames_gen.py similarity index 100% rename from configs/datasets/flames/flames_gen.py rename to configs/datasets/subjective/flames/flames_gen.py diff --git a/configs/datasets/flames/flames_gen_1a58bb.py b/configs/datasets/subjective/flames/flames_gen_1a58bb.py similarity index 96% rename from configs/datasets/flames/flames_gen_1a58bb.py rename to configs/datasets/subjective/flames/flames_gen_1a58bb.py index 1082e217..64a10519 100644 --- a/configs/datasets/flames/flames_gen_1a58bb.py +++ b/configs/datasets/subjective/flames/flames_gen_1a58bb.py @@ -58,5 +58,6 @@ for _name in subjective_all_sets: name=_name, reader_cfg=subjective_reader_cfg, infer_cfg=subjective_infer_cfg, - eval_cfg=subjective_eval_cfg + eval_cfg=subjective_eval_cfg, + mode='singlescore', )) diff --git a/opencompass/configs/datasets/flames/README.md b/opencompass/configs/datasets/subjective/flames/README.md similarity index 100% rename from opencompass/configs/datasets/flames/README.md rename to opencompass/configs/datasets/subjective/flames/README.md diff --git a/opencompass/configs/datasets/flames/flames_gen.py b/opencompass/configs/datasets/subjective/flames/flames_gen.py similarity index 100% rename from opencompass/configs/datasets/flames/flames_gen.py rename to opencompass/configs/datasets/subjective/flames/flames_gen.py diff --git a/opencompass/configs/datasets/flames/flames_gen_1a58bb.py b/opencompass/configs/datasets/subjective/flames/flames_gen_1a58bb.py similarity index 96% rename from opencompass/configs/datasets/flames/flames_gen_1a58bb.py rename to opencompass/configs/datasets/subjective/flames/flames_gen_1a58bb.py index 1082e217..64a10519 100644 --- a/opencompass/configs/datasets/flames/flames_gen_1a58bb.py +++ b/opencompass/configs/datasets/subjective/flames/flames_gen_1a58bb.py @@ -58,5 +58,6 @@ for _name in subjective_all_sets: name=_name, reader_cfg=subjective_reader_cfg, infer_cfg=subjective_infer_cfg, - eval_cfg=subjective_eval_cfg + eval_cfg=subjective_eval_cfg, + mode='singlescore', )) diff --git a/opencompass/datasets/__init__.py b/opencompass/datasets/__init__.py index 8f178242..357a6143 100644 --- a/opencompass/datasets/__init__.py +++ b/opencompass/datasets/__init__.py @@ -41,7 +41,6 @@ from .ds1000 import * # noqa: F401, F403 from .ds1000_interpreter import * # noqa: F401, F403 from .eprstmt import * # noqa: F401, F403 from .FinanceIQ import * # noqa: F401, F403 -from .flames import * # noqa: F401, F403 from .flores import * # noqa: F401, F403 from .game24 import * # noqa: F401, F403 from .GaokaoBench import * # noqa: F401, F403 diff --git a/opencompass/datasets/subjective/__init__.py b/opencompass/datasets/subjective/__init__.py index 96d44927..9060ffab 100644 --- a/opencompass/datasets/subjective/__init__.py +++ b/opencompass/datasets/subjective/__init__.py @@ -8,6 +8,7 @@ from .compassbench_control_length_bias import \ CompassBenchControlLengthBiasDataset # noqa: F401, F403 from .corev2 import Corev2Dataset # noqa: F401, F403 from .creationbench import CreationBenchDataset # noqa: F401, F403 +from .flames import FlamesDataset # noqa: F401, F403 from .fofo import FofoDataset # noqa: F401, F403 from .followbench import FollowBenchDataset # noqa: F401, F403 from .information_retrival import IRDataset # noqa: F401, F403 diff --git a/opencompass/datasets/flames.py b/opencompass/datasets/subjective/flames.py similarity index 92% rename from opencompass/datasets/flames.py rename to opencompass/datasets/subjective/flames.py index de2202e9..0c48c4ff 100644 --- a/opencompass/datasets/flames.py +++ b/opencompass/datasets/subjective/flames.py @@ -9,7 +9,7 @@ from datasets import Dataset, DatasetDict from opencompass.registry import LOAD_DATASET from opencompass.utils import get_data_path -from .subjective.subjective_cmp import SubjectiveCmpDataset +from .subjective_cmp import SubjectiveCmpDataset class Config: @@ -36,11 +36,7 @@ def prompt_construct(sample, config: Config): @LOAD_DATASET.register_module() class FlamesDataset(SubjectiveCmpDataset): - def load( - self, - path: str, - name: str, - ): + def load(self, path: str, name: str, *args, **kwargs): path = get_data_path(path, local_mode=True) config = Config(path, f'{name}_config.txt') diff --git a/opencompass/summarizers/subjective/flames.py b/opencompass/summarizers/subjective/flames.py index c0150b74..53cde79c 100644 --- a/opencompass/summarizers/subjective/flames.py +++ b/opencompass/summarizers/subjective/flames.py @@ -21,7 +21,7 @@ def post_process_flames(judgement: str): 分数=3 and extract the score """ - matches = re.findall(r'分数=(\d+)', text) + matches = re.findall(r'分数=(\d+)', judgement) if matches: matches = matches[0] return int(matches)