Update modeling_minicpmv.py
Browse files- modeling_minicpmv.py +2 -2
modeling_minicpmv.py
CHANGED
|
@@ -308,11 +308,11 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
|
|
| 308 |
batch[place] = tensor
|
| 309 |
attention_mask.append(to_add)
|
| 310 |
|
| 311 |
-
|
| 312 |
|
| 313 |
print(attention_mask.shape)
|
| 314 |
print(attention_mask, "ATTENTION")
|
| 315 |
-
attention_mask = attention_mask.to(self.device)
|
| 316 |
# padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1])) for tensor in batch]
|
| 317 |
|
| 318 |
# Step 3: Stack the padded tensors into a single batch
|
|
|
|
| 308 |
batch[place] = tensor
|
| 309 |
attention_mask.append(to_add)
|
| 310 |
|
| 311 |
+
attention_mask = torch.tensor(attention_mask)
|
| 312 |
|
| 313 |
print(attention_mask.shape)
|
| 314 |
print(attention_mask, "ATTENTION")
|
| 315 |
+
# attention_mask = attention_mask.to(self.device)
|
| 316 |
# padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1])) for tensor in batch]
|
| 317 |
|
| 318 |
# Step 3: Stack the padded tensors into a single batch
|