This commit is contained in:
gaotongxiao 2023-07-05 15:26:15 +08:00
parent 1ee80f14d2
commit 381c1ad5a0

View File

@ -1,4 +1,4 @@
import os.path as osp from os.path import exists
from opencompass.openicl.icl_prompt_template import PromptTemplate from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer from opencompass.openicl.icl_inferencer import GenInferencer
@ -44,7 +44,7 @@ bbh_free_form_sets = [
bbh_datasets = [] bbh_datasets = []
for _name in bbh_multiple_choice_sets: for _name in bbh_multiple_choice_sets:
_hint = None _hint = None
if osp.exists(f"{_path_prefix}/lib_prompt/{_name}.txt"): if exists(f"{_path_prefix}/lib_prompt/{_name}.txt"):
_hint = open(f"{_path_prefix}/lib_prompt/{_name}.txt", 'r').read() _hint = open(f"{_path_prefix}/lib_prompt/{_name}.txt", 'r').read()
bbh_infer_cfg = dict( bbh_infer_cfg = dict(
prompt_template=dict( prompt_template=dict(
@ -76,7 +76,7 @@ for _name in bbh_multiple_choice_sets:
for _name in bbh_free_form_sets: for _name in bbh_free_form_sets:
_hint = None _hint = None
if osp.exists(f"{_path_prefix}/lib_prompt/{_name}.txt"): if exists(f"{_path_prefix}/lib_prompt/{_name}.txt"):
_hint = open(f"{_path_prefix}/lib_prompt/{_name}.txt", 'r').read() _hint = open(f"{_path_prefix}/lib_prompt/{_name}.txt", 'r').read()
bbh_infer_cfg = dict( bbh_infer_cfg = dict(
prompt_template=dict( prompt_template=dict(