Update modeling_minicpmv.py
Browse files- modeling_minicpmv.py +2 -3
modeling_minicpmv.py
CHANGED
|
@@ -302,11 +302,10 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
|
|
| 302 |
for pl in range(tensor.shape[1], max_x):
|
| 303 |
#print("here")
|
| 304 |
tensor = torch.cat((tensor, vector_reshaped), dim=1)
|
| 305 |
-
tensor = tensor.to(self.device)
|
| 306 |
-
batch[pl] = tensor
|
| 307 |
to_add.append(0)
|
|
|
|
| 308 |
print(tensor.shape, "UPDATED_SHAPE")
|
| 309 |
-
|
| 310 |
attention_mask.append(to_add)
|
| 311 |
attention_mask = torch.tensor(attention_mask)
|
| 312 |
print(attention_mask.shape)
|
|
|
|
| 302 |
for pl in range(tensor.shape[1], max_x):
|
| 303 |
#print("here")
|
| 304 |
tensor = torch.cat((tensor, vector_reshaped), dim=1)
|
|
|
|
|
|
|
| 305 |
to_add.append(0)
|
| 306 |
+
tensor = tensor.to(self.device)
|
| 307 |
print(tensor.shape, "UPDATED_SHAPE")
|
| 308 |
+
batch[place] = tensor
|
| 309 |
attention_mask.append(to_add)
|
| 310 |
attention_mask = torch.tensor(attention_mask)
|
| 311 |
print(attention_mask.shape)
|