|
@@ -252,7 +252,7 @@ class ModelTrainer:
|
|
|
responses = [completion[0]["content"] for completion in completions]
|
|
|
scores = []
|
|
|
for response in responses:
|
|
|
- reasoning_match = re.search(r"<reasoning>\n(.+?)\n</reasoning>", response, re.DOTALL)
|
|
|
+ reasoning_match = re.search(r"<thinking>\n(.+?)\n</thinking>", response, re.DOTALL)
|
|
|
if reasoning_match:
|
|
|
reasoning_content = reasoning_match.group(1).strip()
|
|
|
# 简单检查推理内容是否包含关键词
|
|
@@ -283,9 +283,9 @@ class ModelTrainer:
|
|
|
:return: XML 标签的完整性得分
|
|
|
"""
|
|
|
count = 0.0
|
|
|
- if text.count("<reasoning>\n") == 1:
|
|
|
+ if text.count("<thinking>\n") == 1:
|
|
|
count += 0.125
|
|
|
- if text.count("\n</reasoning>\n") == 1:
|
|
|
+ if text.count("\n</thinking>\n") == 1:
|
|
|
count += 0.125
|
|
|
if text.count("\n<answer>\n") == 1:
|
|
|
count += 0.125
|
|
@@ -312,7 +312,7 @@ class ModelTrainer:
|
|
|
:param completions: 模型生成的补全内容
|
|
|
:return: 符合软格式要求的得分列表
|
|
|
"""
|
|
|
- pattern = r"<reasoning>.*?</reasoning>\s*<answer>.*?</answer>"
|
|
|
+ pattern = r"<thinking>.*?</thinking>\s*<answer>.*?</answer>"
|
|
|
responses = [completion[0]["content"] for completion in completions]
|
|
|
matches = [re.match(pattern, r) for r in responses]
|
|
|
return [0.5 if match else 0.0 for match in matches]
|
|
@@ -324,7 +324,7 @@ class ModelTrainer:
|
|
|
:param completions: 模型生成的补全内容
|
|
|
:return: 符合严格格式要求的得分列表
|
|
|
"""
|
|
|
- pattern = r"^<reasoning>\n(.+?)\n</reasoning>\n<answer>\n(.+?)\n</answer>\n$"
|
|
|
+ pattern = r"^<thinking>\n(.+?)\n</thinking>\n<answer>\n(.+?)\n</answer>\n$"
|
|
|
responses = [completion[0]["content"] for completion in completions]
|
|
|
scores = []
|
|
|
for response in responses:
|