From f394f0b9e77f9078a47be413e2275f9b12330d52 Mon Sep 17 00:00:00 2001 From: isaacbmiller Date: Sun, 15 Mar 2026 17:53:38 -0500 Subject: [PATCH] fix(grpo): fix list/list division TypeError in partial parse reward calculation --- dspy/teleprompt/bootstrap_trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspy/teleprompt/bootstrap_trace.py b/dspy/teleprompt/bootstrap_trace.py index 2f0cc60cd1..fee1b2ccd6 100644 --- a/dspy/teleprompt/bootstrap_trace.py +++ b/dspy/teleprompt/bootstrap_trace.py @@ -87,7 +87,7 @@ def patched_forward(program_to_use: Module, **kwargs): failed_pred = FailedPrediction( completion_text=completion_str, format_reward=format_failure_score - + (failure_score - format_failure_score) * (present / expected), + + (failure_score - format_failure_score) * (len(present) / len(expected)), ) else: failed_pred = FailedPrediction(completion_text=completion_str, format_reward=format_failure_score)