From 4ca715768ef7e22fb367e00a9ef755d55a3a3898 Mon Sep 17 00:00:00 2001 From: xming521 <1223398803@qq.com> Date: Fri, 13 Jun 2025 21:36:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eenable=5Fthinking=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BB=A5=E6=94=AF=E6=8C=81=E6=8E=A8=E7=90=86=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E7=9A=84=E6=80=9D=E8=80=83=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9B=E6=9B=B4=E6=96=B0repetition=5Fpenalty=E5=92=8Cmax=5Fn?= =?UTF-8?q?ew=5Ftokens=E9=85=8D=E7=BD=AE=E4=BB=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B8=85=E7=90=86=E7=AD=96=E7=95=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weclone/core/inference/offline_infer.py | 2 ++ weclone/data/clean/strategies.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/weclone/core/inference/offline_infer.py b/weclone/core/inference/offline_infer.py index 0fe050f..840d4cd 100644 --- a/weclone/core/inference/offline_infer.py +++ b/weclone/core/inference/offline_infer.py @@ -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, } ) diff --git a/weclone/data/clean/strategies.py b/weclone/data/clean/strategies.py index 7d15170..f6f70d2 100644 --- a/weclone/data/clean/strategies.py +++ b/weclone/data/clean/strategies.py @@ -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] = []