Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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,
|
| 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
|