Skip to content

Commit

Permalink
handle no-label classification case
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmarks committed Mar 26, 2024
1 parent b63cdbf commit 74e214c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fiftyone/utils/hf_hub.py
Original file line number Diff line number Diff line change
@@ -806,7 +806,9 @@ def _build_label_field_converter(
def convert_classification_field(sample_dict, row):
row_content = row["row"]
label_index = row_content[field_name]
label = (feature["names"][label_index],)
if label_index == -1:
return
label = feature["names"][label_index]
if isinstance(label, tuple):
label = label[0]
sample_dict[field_name] = fol.Classification(label=str(label))

0 comments on commit 74e214c

Please sign in to comment.