Woziii commited on
Commit
82d83fb
1 Parent(s): bc7e16f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -68,7 +68,7 @@ def analyze_next_token(input_text, temperature, top_p, top_k):
68
  probabilities = torch.nn.functional.softmax(last_token_logits, dim=-1)
69
  top_k = 10
70
  top_probs, top_indices = torch.topk(probabilities, top_k)
71
- top_words = [tokenizer.decode([idx.item()]).strip() for idx in top_indices]
72
  prob_data = {word: prob.item() for word, prob in zip(top_words, top_probs)}
73
  prob_plot = plot_probabilities(prob_data)
74
 
 
68
  probabilities = torch.nn.functional.softmax(last_token_logits, dim=-1)
69
  top_k = 10
70
  top_probs, top_indices = torch.topk(probabilities, top_k)
71
+ top_words = [tokenizer.decode(idx.item()).strip() for idx in top_indices]
72
  prob_data = {word: prob.item() for word, prob in zip(top_words, top_probs)}
73
  prob_plot = plot_probabilities(prob_data)
74