Update modeling_internlm2.py
Browse files- modeling_internlm2.py +2 -2
modeling_internlm2.py
CHANGED
@@ -1163,9 +1163,9 @@ class InternLM2ForCausalLM(InternLM2PreTrainedModel):
|
|
1163 |
img_embeds, atts_img, img_target = self.img2emb(torch.zeros(1,3,self.im_size,self.im_size).to(image.device).to(image.dtype))
|
1164 |
to_regress_embeds += img_embeds.sum() * 0
|
1165 |
im_mask = torch.zeros(to_regress_embeds.shape[:2]).cuda()
|
1166 |
-
temp_max_length =
|
1167 |
|
1168 |
-
temp_max_length =
|
1169 |
inputs_embeds = to_regress_embeds[:, :temp_max_length]
|
1170 |
attention_mask = attention_mask[:, :temp_max_length]
|
1171 |
targets = targets[:, :temp_max_length]
|
|
|
1163 |
img_embeds, atts_img, img_target = self.img2emb(torch.zeros(1,3,self.im_size,self.im_size).to(image.device).to(image.dtype))
|
1164 |
to_regress_embeds += img_embeds.sum() * 0
|
1165 |
im_mask = torch.zeros(to_regress_embeds.shape[:2]).cuda()
|
1166 |
+
temp_max_length = self.max_length
|
1167 |
|
1168 |
+
temp_max_length = self.max_length
|
1169 |
inputs_embeds = to_regress_embeds[:, :temp_max_length]
|
1170 |
attention_mask = attention_mask[:, :temp_max_length]
|
1171 |
targets = targets[:, :temp_max_length]
|