myownskyW7
commited on
Commit
•
316a14d
1
Parent(s):
f3cf0db
Update modeling_internlm_xcomposer2.py
Browse files
modeling_internlm_xcomposer2.py
CHANGED
@@ -349,8 +349,7 @@ class InternLMXComposer2ForCausalLM(InternLM2PreTrainedModel):
|
|
349 |
im_mask = kwargs.get('im_mask', None)
|
350 |
if im_mask is None and inputs_embeds is not None:
|
351 |
im_mask = torch.zeros(inputs_embeds.shape[:2]).to(
|
352 |
-
inputs_embeds.device)
|
353 |
-
im_mask[:, 1:1 + self.im_seq_len] = 1
|
354 |
im_mask = im_mask.bool()
|
355 |
|
356 |
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|
|
|
349 |
im_mask = kwargs.get('im_mask', None)
|
350 |
if im_mask is None and inputs_embeds is not None:
|
351 |
im_mask = torch.zeros(inputs_embeds.shape[:2]).to(
|
352 |
+
inputs_embeds.device)
|
|
|
353 |
im_mask = im_mask.bool()
|
354 |
|
355 |
output_attentions = output_attentions if output_attentions is not None else self.config.output_attentions
|