From 65d17b9850a251670fc977ab957b82f61bb0dac9 Mon Sep 17 00:00:00 2001 From: Andreas Koepf Date: Tue, 25 Feb 2025 23:27:01 +0100 Subject: [PATCH] add None/empty check to score_answer of cryptarithm --- reasoning_gym/algorithmic/cryptarithm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reasoning_gym/algorithmic/cryptarithm.py b/reasoning_gym/algorithmic/cryptarithm.py index bfa9baa8..15264254 100644 --- a/reasoning_gym/algorithmic/cryptarithm.py +++ b/reasoning_gym/algorithmic/cryptarithm.py @@ -223,6 +223,9 @@ class CryptarithmDataset(ProceduralDataset): Returns: float: The computed score between 0.0 and 1.0. """ + if not answer: + return 0.0 + correct_mapping = {} correct_answer_str = entry["answer"] # e.g. "A=1,B=7,..." for pair in correct_answer_str.split(","):