Add immediate UI update for Generate and Stop buttons (#18)
### Summary The Stop button previously appeared only after the backend generation job actually started, leaving users with no cancel affordance while a request sat in the queue. This PR makes the Stop button visible immediately after clicking **Generate Podcast**. ### Change Adds a single non-queued `.then` step in the click event chain that hides the Generate button and shows the Stop button instantly, before the queued job begins processing.
This commit is contained in:
parent
e611deafac
commit
84710c4d2b
1 changed files with 5 additions and 0 deletions
|
@ -992,6 +992,11 @@ Or paste text directly and it will auto-assign speakers.""",
|
|||
inputs=[],
|
||||
outputs=[audio_output, complete_audio_output],
|
||||
queue=False
|
||||
).then( # Immediate UI update to hide Generate, show Stop (non-queued)
|
||||
fn=lambda: (gr.update(visible=False), gr.update(visible=True)),
|
||||
inputs=[],
|
||||
outputs=[generate_btn, stop_btn],
|
||||
queue=False
|
||||
).then(
|
||||
fn=generate_podcast_wrapper,
|
||||
inputs=[num_speakers, script_input] + speaker_selections + [cfg_scale],
|
||||
|
|
Loading…
Reference in a new issue