Spaces:
Runtime error
Runtime error
yash161101
commited on
Commit
•
e2b1dc7
1
Parent(s):
38e3c04
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ with st.form(key='my_form'):
|
|
35 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
36 |
logits = logits[0,-1]
|
37 |
probabilities = torch.nn.functional.softmax(logits)
|
38 |
-
best_logits, best_indices = logits.topk(
|
39 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
40 |
text.append(best_indices[0].item())
|
41 |
best_probabilities = probabilities[best_indices].tolist()
|
|
|
35 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
36 |
logits = logits[0,-1]
|
37 |
probabilities = torch.nn.functional.softmax(logits)
|
38 |
+
best_logits, best_indices = logits.topk(0)
|
39 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
40 |
text.append(best_indices[0].item())
|
41 |
best_probabilities = probabilities[best_indices].tolist()
|