Skip to content

Commit 3f64342

Browse files
committed
add
1 parent e12c89a commit 3f64342

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

opencompass/utils/datasets.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ def get_data_path(dataset_id: str, local_mode: bool = False):
4545
return hf_id
4646
else:
4747
# for the local path
48-
local_path = DATASETS_MAPPING[dataset_id]['local']
48+
try:
49+
local_path = DATASETS_MAPPING[dataset_id]['local']
50+
except:
51+
local_path = dataset_id
52+
get_logger().info(f"The dataset_id {dataset_id} is not in datasets mapping. Use it as local path.")
4953
local_path = os.path.join(cache_dir, local_path)
5054

5155
if not os.path.exists(local_path):

opencompass/utils/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ def init_llm_evaluator(evalcfg):
474474
assert 'judge_cfg' in evalcfg.keys()
475475
eval_cfg['judge_cfg'] = evalcfg['judge_cfg']
476476
if 'prompt' in evalcfg.keys():
477-
eval_cfg['prompt_template']['template']['round'][0]['prompt'] = evalcfg['prompt']
477+
for i in range(len(eval_cfg['prompt_template']['messages'])):
478+
if isinstance(eval_cfg['prompt_template']['messages'][i], dict) and eval_cfg['prompt_template']['messages'][i]['role'] == 'user':
479+
eval_cfg['prompt_template']['messages'][i]['content'] = evalcfg['prompt']
478480
return eval_cfg
479481

480482
def init_cascade_evaluator(evalcfg, func_locals):

0 commit comments

Comments
 (0)