peder
commited on
Commit
·
d3a6ca6
1
Parent(s):
7f12b65
top k back
Browse files
app.py
CHANGED
@@ -203,14 +203,6 @@ def main():
|
|
203 |
value=int(query_params.get("max_length", [256])[0]),
|
204 |
step=1
|
205 |
)
|
206 |
-
# top_k = st.sidebar.slider(
|
207 |
-
# label='Top-k',
|
208 |
-
# help="The number of highest probability vocabulary tokens to keep for top-k-filtering",
|
209 |
-
# min_value=40,
|
210 |
-
# max_value=80,
|
211 |
-
# value=int(query_params.get("top_k", [50])[0]),
|
212 |
-
# step=1
|
213 |
-
# )
|
214 |
top_p = st.sidebar.slider(
|
215 |
label='Top-p',
|
216 |
help="Only the most probable tokens with probabilities that add up to `top_p` or higher are kept for "
|
@@ -235,9 +227,17 @@ def main():
|
|
235 |
index=int(query_params.get("do_sample", ["true"])[
|
236 |
0].lower()[0] in ("t", "y", "1")),
|
237 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
generation_kwargs = {
|
239 |
"max_length": max_length,
|
240 |
-
|
241 |
"top_p": top_p,
|
242 |
"temperature": temperature,
|
243 |
"do_sample": do_sample,
|
|
|
203 |
value=int(query_params.get("max_length", [256])[0]),
|
204 |
step=1
|
205 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
top_p = st.sidebar.slider(
|
207 |
label='Top-p',
|
208 |
help="Only the most probable tokens with probabilities that add up to `top_p` or higher are kept for "
|
|
|
227 |
index=int(query_params.get("do_sample", ["true"])[
|
228 |
0].lower()[0] in ("t", "y", "1")),
|
229 |
)
|
230 |
+
top_k = st.sidebar.slider(
|
231 |
+
label='Top-k',
|
232 |
+
help="The number of highest probability vocabulary tokens to keep for top-k-filtering",
|
233 |
+
min_value=40,
|
234 |
+
max_value=80,
|
235 |
+
value=int(query_params.get("top_k", [50])[0]),
|
236 |
+
step=1
|
237 |
+
)
|
238 |
generation_kwargs = {
|
239 |
"max_length": max_length,
|
240 |
+
"top_k": top_k,
|
241 |
"top_p": top_p,
|
242 |
"temperature": temperature,
|
243 |
"do_sample": do_sample,
|