Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,6 +87,7 @@ Translated into the Style of Abraham Lincoln: corn fields ( permeate illinois /
|
|
87 |
|
88 |
informal english: """
|
89 |
|
|
|
90 |
|
91 |
def BestProbs(prompt):
|
92 |
prompt = prompt.strip()
|
@@ -175,9 +176,9 @@ def BestProbs5(prompt):
|
|
175 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
176 |
logits = logits[0,-1]
|
177 |
probabilities = torch.nn.functional.softmax(logits)
|
178 |
-
best_logits, best_indices = logits.topk(
|
179 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
180 |
-
for i in best_words[0:
|
181 |
#print(i)
|
182 |
print("\n")
|
183 |
g = (prompt + i)
|
|
|
87 |
|
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()
|
|
|
176 |
logits, past_key_values = model(myinput, past_key_values = past_key_values, return_dict=False)
|
177 |
logits = logits[0,-1]
|
178 |
probabilities = torch.nn.functional.softmax(logits)
|
179 |
+
best_logits, best_indices = logits.topk(number_of_outputs)
|
180 |
best_words = [tokenizer.decode([idx.item()]) for idx in best_indices]
|
181 |
+
for i in best_words[0:number_of_outputs]:
|
182 |
#print(i)
|
183 |
print("\n")
|
184 |
g = (prompt + i)
|