Azrail commited on
Commit
24fb7a8
·
verified ·
1 Parent(s): ac9f33c

Upload SmalLmForCausalLM

Browse files
Files changed (1) hide show
  1. model.py +2 -0
model.py CHANGED
@@ -635,6 +635,8 @@ class SmalLmModel(SmalLmPreTrainedModel):
635
  cache_position: Optional[torch.Tensor],
636
  ):
637
  if USE_FLASH and inputs_embeds.is_cuda:
 
 
638
  return attention_mask
639
  dtype, device = inputs_embeds.dtype, inputs_embeds.device
640
  past_token = (
 
635
  cache_position: Optional[torch.Tensor],
636
  ):
637
  if USE_FLASH and inputs_embeds.is_cuda:
638
+ if attention_mask is None:
639
+ attention_mask = torch.ones(*inputs_embeds.shape[:2], device=inputs_embeds.device)
640
  return attention_mask
641
  dtype, device = inputs_embeds.dtype, inputs_embeds.device
642
  past_token = (