Update modeling_minicpmv.py
Browse files- modeling_minicpmv.py +1 -1
modeling_minicpmv.py
CHANGED
|
@@ -297,7 +297,7 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
|
|
| 297 |
attention_mask.append(to_add)
|
| 298 |
attention_mask = torch.tensor(attention_mask)
|
| 299 |
|
| 300 |
-
padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1])) for tensor in batch]
|
| 301 |
|
| 302 |
# Step 3: Stack the padded tensors into a single batch
|
| 303 |
for stuff in batch:
|
|
|
|
| 297 |
attention_mask.append(to_add)
|
| 298 |
attention_mask = torch.tensor(attention_mask)
|
| 299 |
|
| 300 |
+
padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1]), padding_value=0.0) for tensor in batch]
|
| 301 |
|
| 302 |
# Step 3: Stack the padded tensors into a single batch
|
| 303 |
for stuff in batch:
|