Skip to content

Commit 14d6354

Browse files
committed
Fix last math reward test
1 parent b74a47c commit 14d6354

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/unit_tests/rl/test_math_reward.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ def test_call_multiple_answer_tags(self):
187187
"""Test __call__ with multiple answer tags (should use first one)."""
188188
response = "First answer: <answer>42</answer> Second: <answer>43</answer>"
189189
self.assertEqual(self.reward("prompt", response, "42"), 1.0)
190-
self.assertEqual(self.reward("prompt", response, "43"), 0.1)
190+
self.assertEqual(self.reward("prompt", response, "43"), 0.0)
191+
192+
# Test case where target appears outside answer tags for partial credit
193+
response_with_partial = (
194+
"I think the answer is 43. <answer>42</answer> But 43 might be better."
195+
)
196+
self.assertEqual(self.reward("prompt", response_with_partial, "43"), 0.1)
191197

192198

193199
if __name__ == "__main__":

0 commit comments

Comments
 (0)