Skip to content

Commit

Permalink
Pop multilabel label if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvaBansal00 committed Oct 23, 2024
1 parent df635bc commit 9adf432
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/autolabel/tasks/attribute_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9adf432

Please sign in to comment.