zwt123home123 commited on
Commit
1506a1b
1 Parent(s): 2c3c568

Update modeling_internlm2.py

Browse files
Files changed (1) hide show
  1. modeling_internlm2.py +3 -3
modeling_internlm2.py CHANGED
@@ -311,9 +311,9 @@ class InternLM2Attention(nn.Module):
311
  self.attncut = True
312
  self.headcut = True
313
  self.layercut = True
314
- self.layercut_idx = 36
315
- self.offset = 41
316
- head_num=24
317
  self.mask = torch.load("headcut_mask/internvl2.0_26B/mask_"+str(head_num)+".pth")
318
  def _init_rope(self):
319
  if self.config.rope_scaling is None:
 
311
  self.attncut = True
312
  self.headcut = True
313
  self.layercut = True
314
+ self.layercut_idx = 36 # number of layer kept
315
+ self.offset = 41 # system prompt token length
316
+ head_num=24 # num of heads kept on average
317
  self.mask = torch.load("headcut_mask/internvl2.0_26B/mask_"+str(head_num)+".pth")
318
  def _init_rope(self):
319
  if self.config.rope_scaling is None: