kb2022 commited on
Commit
c908690
·
verified ·
1 Parent(s): 0205b12

Upload llm.py

Browse files
Files changed (1) hide show
  1. utils/llm.py +2 -1
utils/llm.py CHANGED
@@ -105,7 +105,8 @@ NGワード:
105
  next_token_logits = output.logits[0, -1, :]
106
  next_token_probs = torch.softmax(next_token_logits, dim=-1)
107
  sorted_ids = torch.argsort(next_token_probs, descending=True, dim=-1)
108
-
 
109
  for i in range(2):
110
  prob_d[tokenizer.decode(sorted_ids[i])] = next_token_probs[sorted_ids[i]].item()
111
 
 
105
  next_token_logits = output.logits[0, -1, :]
106
  next_token_probs = torch.softmax(next_token_logits, dim=-1)
107
  sorted_ids = torch.argsort(next_token_probs, descending=True, dim=-1)
108
+
109
+ prob_d = {}
110
  for i in range(2):
111
  prob_d[tokenizer.decode(sorted_ids[i])] = next_token_probs[sorted_ids[i]].item()
112