fix missing tags parameter

This commit is contained in:
YeAnbang
2025-05-21 10:51:32 +08:00
parent 88e3b09c79
commit 78a06f5ce3
4 changed files with 27 additions and 10 deletions

View File

@@ -46,6 +46,7 @@ class BaseProducer:
eval_dataset_config=None,
eval_interval=-1, # disable evaluation
evaluation_function_type="think_answer_tags",
response_format_tags=None,
eval_save_dir: str = "./eval",
project_name: str = None,
run_name: str = None,
@@ -148,6 +149,7 @@ class BaseProducer:
self.evaluation_function = boxed_math_reward_fn
else:
raise ValueError(f"Unknown evaluation function type {evaluation_function_type}")
self.response_format_tags = response_format_tags
else:
raise ValueError("eval_dataset_config is not defined")
self.device = get_current_device()
@@ -217,6 +219,7 @@ class BaseProducer:
eval_outputs["response_idx"][m][n],
tokenizer=self.tokenizer,
eval_mode=True,
tags=self.response_format_tags,
)
for m in range(eval_outputs["input_ids"].size(0))
for n in range(eval_outputs["input_ids"].size(1))
@@ -324,6 +327,7 @@ class SimpleProducer(BaseProducer):
eval_dataset_config=None,
eval_interval=-1, # disable evaluation
evaluation_function_type="think_answer_tags",
response_format_tags=None,
eval_save_dir: str = "./eval",
eval_generation_config={},
project_name: str = None,
@@ -349,6 +353,7 @@ class SimpleProducer(BaseProducer):
eval_dataset_config=eval_dataset_config,
eval_interval=eval_interval,
evaluation_function_type=evaluation_function_type,
response_format_tags=response_format_tags,
eval_save_dir=eval_save_dir,
project_name=project_name,
run_name=run_name,