From b1ccf66adba0325a2632e5cd7f14f834d6fdd27f Mon Sep 17 00:00:00 2001 From: Jialiang Xu Date: Thu, 24 Oct 2024 19:19:19 -0700 Subject: [PATCH] capture cases where an instance has no extra data --- .../adapters/multiple_choice_joint_chain_of_thought_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helm/benchmark/adaptation/adapters/multiple_choice_joint_chain_of_thought_adapter.py b/src/helm/benchmark/adaptation/adapters/multiple_choice_joint_chain_of_thought_adapter.py index 6dcf56b4e7..5dc800340b 100644 --- a/src/helm/benchmark/adaptation/adapters/multiple_choice_joint_chain_of_thought_adapter.py +++ b/src/helm/benchmark/adaptation/adapters/multiple_choice_joint_chain_of_thought_adapter.py @@ -76,7 +76,7 @@ def construct_example_prompt(self, instance: Instance, include_output: bool, ref if include_output: chain_of_thought = ( self.adapter_spec.chain_of_thought_prefix - + instance.extra_data.get("chain_of_thought", "") + + instance.extra_data.get("chain_of_thought", "") if instance.extra_data else "" + self.adapter_spec.chain_of_thought_suffix ) result += self.adapter_spec.output_prefix + chain_of_thought + output + self.adapter_spec.output_suffix