Update modeling_minicpmv.py
Browse files299 unmodified lines3003013023033043053063072 unmodified lines310311312313314315316299 unmodified linesfor pl in range(tensor.shape[1]):to_add.append(1)for pl in range(tensor.shape[1], max_x):tensor = torch.cat((tensor, vector_reshaped), dim=1)to_add.append(0)attention_mask.append(to_add)attention_mask = torch.tensor(attention_mask)2 unmodified lines# Step 3: Stack the padded tensors into a single batchfor stuff in batch:print(stuff.shape, "SHAPE")batch = torch.cat(padded_tensors, dim=0)print(batch.shape)print(batch)# output_ids = self._decode(input_embeds, tokenizer, **kwargs)299 unmodified lines3003013023033043053063073083092 unmodified lines312313314315316317318299 unmodified linesfor pl in range(tensor.shape[1]):to_add.append(1)for pl in range(tensor.shape[1], max_x):print("here")tensor = torch.cat((tensor, vector_reshaped), dim=1)to_add.append(0)print(tensor.shape, "UPDATED_SHAPE")attention_mask.append(to_add)attention_mask = torch.tensor(attention_mask)2 unmodified lines# Step 3: Stack the padded tensors into a single batchfor stuff in batch:print(stuff.shape, "SHAPE")batch = torch.cat(batch, dim=0)print(batch.shape)print(batch)# output_ids = self._decode(input_embeds, tokenizer, **kwargs)
modeling_minicpmv.py+3-1