Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -88,6 +88,7 @@ Translated into the Style of Abraham Lincoln: corn fields ( permeate illinois /
|
|
88 |
informal english: """
|
89 |
|
90 |
number_of_outputs = st.sidebar.slider("Number of Outputs", 5, 20)
|
|
|
91 |
|
92 |
def BestProbs(prompt):
|
93 |
prompt = prompt.strip()
|
@@ -229,7 +230,7 @@ with st.form(key='my_form'):
|
|
229 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
230 |
logits = logits[0,-1]
|
231 |
probabilities = torch.nn.functional.softmax(logits)
|
232 |
-
best_logits, best_indices = logits.topk(
|
233 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
234 |
text.append(best_indices[0].item())
|
235 |
best_probabilities = probabilities[best_indices].tolist()
|
|
|
88 |
informal english: """
|
89 |
|
90 |
number_of_outputs = st.sidebar.slider("Number of Outputs", 5, 20)
|
91 |
+
log_nums = st.sidebar.slider("How Many Log Outputs?", 50, 600)
|
92 |
|
93 |
def BestProbs(prompt):
|
94 |
prompt = prompt.strip()
|
|
|
230 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
231 |
logits = logits[0,-1]
|
232 |
probabilities = torch.nn.functional.softmax(logits)
|
233 |
+
best_logits, best_indices = logits.topk(log_nums)
|
234 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
235 |
text.append(best_indices[0].item())
|
236 |
best_probabilities = probabilities[best_indices].tolist()
|