Update tokenizer_utils.py
This commit is contained in:
parent
9dc29f50ab
commit
191f2e2261
1 changed files with 1 additions and 1 deletions
|
|
@ -834,7 +834,7 @@ def fix_untrained_tokens(model, tokenizer, train_dataset, eps = 1e-16):
|
|||
# We instead check for repeated vectors
|
||||
lm_head_where = torch.where(indicator_untrained1)[0]
|
||||
lm_head_bad = lm_head_matrix[lm_head_where]
|
||||
lm_head_bad = lm_head_bad.cpu().to(torch.float32).numpy().round(3)
|
||||
lm_head_bad = lm_head_bad.cpu().float().numpy().round(3)
|
||||
from collections import Counter
|
||||
counter = Counter()
|
||||
for row in lm_head_bad: counter[hash(row.data.tobytes())] += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue