Former-commit-id: 64cb947c60398dfdfc2877f898147b0240089ea3
This commit is contained in:
hiyouga 2024-09-01 21:07:49 +08:00
parent cb776752f6
commit 413a206652

View File

@ -93,7 +93,7 @@ class MultiModalDataCollatorForSeq2Seq(DataCollatorForSeq2Seq):
else: else:
image_grid_thw.append(torch.tensor(feature["image_grid_thw"], dtype=torch.long)) image_grid_thw.append(torch.tensor(feature["image_grid_thw"], dtype=torch.long))
extra_features["image_grid_thw"] = torch.cat(pixel_values, dim=0) extra_features["image_grid_thw"] = torch.cat(image_grid_thw, dim=0)
if extra_features["image_grid_thw"].numel() == 0: if extra_features["image_grid_thw"].numel() == 0:
extra_features["image_grid_thw"] = None extra_features["image_grid_thw"] = None