Update modeling_minicpmv.py
Browse files- modeling_minicpmv.py +5 -4
modeling_minicpmv.py
CHANGED
|
@@ -298,16 +298,17 @@ class MiniCPMV(MiniCPMVPreTrainedModel):
|
|
| 298 |
|
| 299 |
for place, tensor in enumerate(batch):
|
| 300 |
to_add = []
|
| 301 |
-
for pl in range(tensor.shape[1]):
|
| 302 |
-
to_add.append(
|
| 303 |
bound = 0
|
| 304 |
-
|
|
|
|
| 305 |
if bound == 0:
|
| 306 |
bound = pl
|
| 307 |
|
| 308 |
#print("here")
|
| 309 |
tensor = torch.cat((vector_reshaped, tensor), dim=1)
|
| 310 |
-
to_add.append(
|
| 311 |
# tensor = tensor.to(self.device)
|
| 312 |
if bound != 0:
|
| 313 |
print(tensor[0,bound-1], " BOUND")
|
|
|
|
| 298 |
|
| 299 |
for place, tensor in enumerate(batch):
|
| 300 |
to_add = []
|
| 301 |
+
for pl in range(0, max_x - tensor.shape[1]):
|
| 302 |
+
to_add.append(0)
|
| 303 |
bound = 0
|
| 304 |
+
|
| 305 |
+
for pl in range(max_x - tensor.shape[1], max_x):
|
| 306 |
if bound == 0:
|
| 307 |
bound = pl
|
| 308 |
|
| 309 |
#print("here")
|
| 310 |
tensor = torch.cat((vector_reshaped, tensor), dim=1)
|
| 311 |
+
to_add.append(1)
|
| 312 |
# tensor = tensor.to(self.device)
|
| 313 |
if bound != 0:
|
| 314 |
print(tensor[0,bound-1], " BOUND")
|