wuzhiying2023 JaheimLee commited on
Commit
6914c01
1 Parent(s): 670d17e

Update modeling_baichuan.py (#6)

Browse files

- Update modeling_baichuan.py (0498e281c48996cb9ff7b3f1485830cdb626ef58)


Co-authored-by: JaheimLee <[email protected]>

Files changed (1) hide show
  1. modeling_baichuan.py +1 -1
modeling_baichuan.py CHANGED
@@ -513,7 +513,7 @@ class NormHead(nn.Module):
513
  norm_weight = nn.functional.normalize(self.weight)
514
  elif self.first_flag:
515
  self.first_flag = False
516
- self.weight = nn.Parameter(nn.functional.normalize(self.weight))
517
  norm_weight = self.weight
518
  else:
519
  norm_weight = self.weight
 
513
  norm_weight = nn.functional.normalize(self.weight)
514
  elif self.first_flag:
515
  self.first_flag = False
516
+ self.weight.data = nn.functional.normalize(self.weight)
517
  norm_weight = self.weight
518
  else:
519
  norm_weight = self.weight