From dd9954b4f3ab8bf10f058eafe5ddfac201fe0094 Mon Sep 17 00:00:00 2001 From: Atsunori Fujita Date: Fri, 18 Oct 2024 09:33:03 +0000 Subject: [PATCH] Fix #349 Signed-off-by: Atsunori Fujita --- examples/nlp/data/steerlm/attribute_annotate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/nlp/data/steerlm/attribute_annotate.py b/examples/nlp/data/steerlm/attribute_annotate.py index 51af3dbdf..36cab2c11 100644 --- a/examples/nlp/data/steerlm/attribute_annotate.py +++ b/examples/nlp/data/steerlm/attribute_annotate.py @@ -71,7 +71,8 @@ def get_reward( reward_out = output_dict["rewards"].flatten().tolist() all_rewards.append(reward_out) - all_exceeded += output_dict["exceeded"].tolist() + if output_dict.get('exceeded', None) is not None: + all_exceeded += output_dict["exceeded"].tolist() return all_rewards, all_exceeded