Commit ·
770e96d
1
Parent(s): 2a43365
fix: keep question textbox intact when Stop cancels the run
Browse files.then() fires on any termination (success, error, cancel) — so Stop was
clearing the textbox along with everything else, forcing the user to
retype their question. Switching to .success() limits the auto-clear to
clean completions only.
app.py
CHANGED
|
@@ -2610,9 +2610,10 @@ with gr.Blocks(
|
|
| 2610 |
inputs=[question, max_turns, memory_strategy, temperature],
|
| 2611 |
outputs=[answer, trace],
|
| 2612 |
)
|
| 2613 |
-
|
| 2614 |
-
|
| 2615 |
-
|
|
|
|
| 2616 |
fn=lambda: "",
|
| 2617 |
inputs=[],
|
| 2618 |
outputs=[question],
|
|
|
|
| 2610 |
inputs=[question, max_turns, memory_strategy, temperature],
|
| 2611 |
outputs=[answer, trace],
|
| 2612 |
)
|
| 2613 |
+
# .success() (not .then()) so the textbox is cleared ONLY on a clean run.
|
| 2614 |
+
# If Stop cancels the generator we leave the question intact, so the user
|
| 2615 |
+
# can tweak it and re-run without retyping.
|
| 2616 |
+
run_event.success(
|
| 2617 |
fn=lambda: "",
|
| 2618 |
inputs=[],
|
| 2619 |
outputs=[question],
|