Terry Zhuo
commited on
Commit
·
d693904
1
Parent(s):
3a99615
fix next and prev
Browse files
app.py
CHANGED
|
@@ -505,13 +505,13 @@ with main_block as demo:
|
|
| 505 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 506 |
)
|
| 507 |
next_button.click(
|
| 508 |
-
update_display,
|
| 509 |
-
inputs=[search_input,
|
| 510 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 511 |
)
|
| 512 |
prev_button.click(
|
| 513 |
-
update_display,
|
| 514 |
-
inputs=[search_input,
|
| 515 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 516 |
)
|
| 517 |
# Initial load
|
|
|
|
| 505 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 506 |
)
|
| 507 |
next_button.click(
|
| 508 |
+
lambda search, index, show_test: update_display(search, index + 1, show_test),
|
| 509 |
+
inputs=[search_input, index_slider, show_test],
|
| 510 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 511 |
)
|
| 512 |
prev_button.click(
|
| 513 |
+
lambda search, index, show_test: update_display(search, index - 1, show_test),
|
| 514 |
+
inputs=[search_input, index_slider, show_test],
|
| 515 |
outputs=[task_id_output, code_completion, nl_instruction, test_cases, count_output, index_slider]
|
| 516 |
)
|
| 517 |
# Initial load
|