新增enable_thinking参数以支持推理过程中的思考功能;更新repetition_penalty和max_new_tokens配置以优化数据清理策略。

This commit is contained in:
xming521
2025-06-13 21:36:06 +08:00
parent 55fdfe2520
commit 4ca715768e
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -26,6 +26,7 @@ def vllm_infer(
max_samples: Optional[int] = None,
vllm_config: str = "{}",
save_name: str = "generated_predictions.jsonl",
enable_thinking: bool = False,
temperature: float = 0.95,
top_p: float = 0.7,
top_k: int = 50,
@@ -61,6 +62,7 @@ def vllm_infer(
"top_k": top_k,
"max_new_tokens": max_new_tokens,
"repetition_penalty": repetition_penalty,
"enable_thinking": enable_thinking,
}
)
+2 -1
View File
@@ -117,8 +117,9 @@ class LLMCleaningStrategy(CleaningStrategy):
template=self.make_dataset_config.template,
temperature=0,
guided_decoding_class=QaPairScore,
repetition_penalty=1.2,
repetition_penalty=1.5,
bad_words=[r"\n"],
max_new_tokens=self.make_dataset_config.messages_max_length + 1024, # add prompt length
)
parsed_scores: List[QaPairScore] = []