Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/open_r1/grpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def accuracy_reward(completions, solution, **kwargs):
],
extraction_mode="first_match",
)
# Reward 1 if the content is the same as the ground truth, 0 otherwise
reward = float(verify(answer_parsed, gold_parsed))
try:
# Reward 1 if the content is the same as the ground truth, 0 otherwise
reward = float(verify(answer_parsed, gold_parsed))
except Exception as e:
reward = 0
else:
# If the gold solution is not parseable, we reward 1 to skip this example
reward = 1.0
Expand Down
Loading