Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -99,9 +99,9 @@ def BestProbs2(prompt):
|
|
99 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
100 |
logits = logits[0,-1]
|
101 |
probabilities = torch.nn.functional.softmax(logits)
|
102 |
-
best_logits, best_indices = logits.topk(
|
103 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
104 |
-
for i in best_words[0:
|
105 |
print(i)
|
106 |
st.write(i)
|
107 |
|
@@ -130,7 +130,9 @@ with st.form(key='my_form'):
|
|
130 |
print("----")
|
131 |
st.write("___")
|
132 |
m = BestProbs(prompt)
|
|
|
133 |
st.write(m)
|
|
|
134 |
if submit_button3:
|
135 |
print("----")
|
136 |
st.write("___")
|
|
|
99 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
100 |
logits = logits[0,-1]
|
101 |
probabilities = torch.nn.functional.softmax(logits)
|
102 |
+
best_logits, best_indices = logits.topk(20)
|
103 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
104 |
+
for i in best_words[0:20]:
|
105 |
print(i)
|
106 |
st.write(i)
|
107 |
|
|
|
130 |
print("----")
|
131 |
st.write("___")
|
132 |
m = BestProbs(prompt)
|
133 |
+
st.write("___")
|
134 |
st.write(m)
|
135 |
+
st.write("___")
|
136 |
if submit_button3:
|
137 |
print("----")
|
138 |
st.write("___")
|