Update modeling_minicpmv.py
Browse files307 unmodified lines308309310311312313314315316317318307 unmodified linesbatch[place] = tensorattention_mask.append(to_add)# attention_mask = torch.tensor(attention_mask)print(attention_mask.shape)print(attention_mask, "ATTENTION")attention_mask = attention_mask.to(self.device)# padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1])) for tensor in batch]# Step 3: Stack the padded tensors into a single batch307 unmodified lines308309310311312313314315316317318307 unmodified linesbatch[place] = tensorattention_mask.append(to_add)attention_mask = torch.tensor(attention_mask)print(attention_mask.shape)print(attention_mask, "ATTENTION")# attention_mask = attention_mask.to(self.device)# padded_tensors = [torch.nn.functional.pad(tensor, (0, 0, 0, max_x - tensor.shape[1])) for tensor in batch]# Step 3: Stack the padded tensors into a single batch
modeling_minicpmv.py+2-2