Skip to content

Commit

Permalink
Merge pull request #61 from tanganke/tanganke-patch-1
Browse files Browse the repository at this point in the history
Update clip_dataset.py
  • Loading branch information
tanganke authored Jan 5, 2025
2 parents 7316283 + 350c2dc commit 5c73d73
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fusion_bench/dataset/clip_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ def __getitem__(self, idx: int):
else:
# if processor is None, return the raw image directly
inputs = image
# convert boolean label to int, this is for the case when the label is a binary classification task
if isinstance(item["label"], bool):
item["label"] = 1 if item["label"] else 0
return inputs, item["label"]

0 comments on commit 5c73d73

Please sign in to comment.