gradio 6: Examples nested list, Slider keyword args
Browse files
app.py
CHANGED
|
@@ -176,9 +176,9 @@ with gr.Blocks(title="RustLean FIM Playground") as demo:
|
|
| 176 |
interactive=True,
|
| 177 |
)
|
| 178 |
with gr.Accordion("Sampling", open=False):
|
| 179 |
-
temperature = gr.Slider(0.0, 1.5, value=0.2, step=0.05, label="temperature")
|
| 180 |
-
top_p = gr.Slider(0.1, 1.0, value=0.9, step=0.05, label="top_p")
|
| 181 |
-
max_tokens = gr.Slider(16, 256, value=96, step=8, label="max tokens")
|
| 182 |
with gr.Row():
|
| 183 |
btn = gr.Button("Complete at cursor", variant="primary")
|
| 184 |
clear = gr.Button("Reset")
|
|
@@ -195,7 +195,7 @@ with gr.Blocks(title="RustLean FIM Playground") as demo:
|
|
| 195 |
interactive=True,
|
| 196 |
)
|
| 197 |
|
| 198 |
-
gr.Examples(examples=EXAMPLES, inputs=[code_in, temperature, max_tokens, top_p])
|
| 199 |
|
| 200 |
btn.click(
|
| 201 |
complete,
|
|
|
|
| 176 |
interactive=True,
|
| 177 |
)
|
| 178 |
with gr.Accordion("Sampling", open=False):
|
| 179 |
+
temperature = gr.Slider(minimum=0.0, maximum=1.5, value=0.2, step=0.05, label="temperature")
|
| 180 |
+
top_p = gr.Slider(minimum=0.1, maximum=1.0, value=0.9, step=0.05, label="top_p")
|
| 181 |
+
max_tokens = gr.Slider(minimum=16, maximum=256, value=96, step=8, label="max tokens")
|
| 182 |
with gr.Row():
|
| 183 |
btn = gr.Button("Complete at cursor", variant="primary")
|
| 184 |
clear = gr.Button("Reset")
|
|
|
|
| 195 |
interactive=True,
|
| 196 |
)
|
| 197 |
|
| 198 |
+
gr.Examples(examples=[list(e) for e in EXAMPLES], inputs=[code_in, temperature, max_tokens, top_p])
|
| 199 |
|
| 200 |
btn.click(
|
| 201 |
complete,
|