Mar2Ding commited on
Commit
c42a923
1 Parent(s): 221c669

Update modeling_internlm2.py

Browse files
Files changed (1) hide show
  1. modeling_internlm2.py +2 -2
modeling_internlm2.py CHANGED
@@ -1113,9 +1113,9 @@ class InternLM2ForCausalLM(InternLM2PreTrainedModel):
1113
  img_embeds, atts_img, img_target = self.img2emb(torch.zeros(1,3,self.im_size,self.im_size).to(image.device).to(image.dtype))
1114
  to_regress_embeds += img_embeds.sum() * 0
1115
  im_mask = torch.zeros(to_regress_embeds.shape[:2]).cuda()
1116
- temp_max_length = 2048
1117
 
1118
- temp_max_length = 2048
1119
  inputs_embeds = to_regress_embeds[:, :temp_max_length]
1120
  attention_mask = attention_mask[:, :temp_max_length]
1121
  targets = targets[:, :temp_max_length]
 
1113
  img_embeds, atts_img, img_target = self.img2emb(torch.zeros(1,3,self.im_size,self.im_size).to(image.device).to(image.dtype))
1114
  to_regress_embeds += img_embeds.sum() * 0
1115
  im_mask = torch.zeros(to_regress_embeds.shape[:2]).cuda()
1116
+ temp_max_length = self.max_length
1117
 
1118
+ temp_max_length = self.max_length
1119
  inputs_embeds = to_regress_embeds[:, :temp_max_length]
1120
  attention_mask = attention_mask[:, :temp_max_length]
1121
  targets = targets[:, :temp_max_length]