From 9adf4325c4b6c9fe644ae90cef7144ef587b206a Mon Sep 17 00:00:00 2001 From: DhruvaBansal00 Date: Wed, 23 Oct 2024 15:13:37 -0700 Subject: [PATCH] Pop multilabel label if empty --- src/autolabel/tasks/attribute_extraction.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/autolabel/tasks/attribute_extraction.py b/src/autolabel/tasks/attribute_extraction.py index a2fee555..6f59cea9 100644 --- a/src/autolabel/tasks/attribute_extraction.py +++ b/src/autolabel/tasks/attribute_extraction.py @@ -367,6 +367,8 @@ def parse_llm_response( logger.warning( f"Attribute {attr_label} from the LLM response {llm_label} is not in the labels list. Filtered list: {filtered_attr_labels}" ) + if len(filtered_attr_labels) == 0: + llm_label.pop(attribute["name"], None) return LLMAnnotation( curr_sample=pickle.dumps(curr_sample), successfully_labeled=successfully_labeled,