davanstrien HF Staff commited on
Commit
93b1c2c
·
verified ·
1 Parent(s): 1de10c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ def get_next_token_probs(text):
26
  next_token_probs = torch.softmax(next_token_logits, dim=0)
27
 
28
  # Get top-5 tokens and their probabilities
29
- topk_probs, topk_indices = torch.topk(next_token_probs, 5)
30
  topk_tokens = [tokenizer.decode([idx]) for idx in topk_indices]
31
 
32
  # Format the results as strings
 
26
  next_token_probs = torch.softmax(next_token_logits, dim=0)
27
 
28
  # Get top-5 tokens and their probabilities
29
+ topk_probs, topk_indices = torch.topk(next_token_probs, 20)
30
  topk_tokens = [tokenizer.decode([idx]) for idx in topk_indices]
31
 
32
  # Format the results as strings