BoxOfColors commited on
Commit
8ed76c6
·
1 Parent(s): d3cd6e0

Stop Generate from going silent: merge watchdog-arm into the click event

Browse files

Two prior attempts (removing then reworking the standalone fn=None
.then() step) didn't fix it — Generate still never reached the backend
after the button changed state, meaning that whole extra chain link was
the problem, not its inputs value.

Verified in Gradio's own source (events.py): js "runs before fn" on the
SAME event when both are given — it isn't a separate chain link. Moved
the watchdog-arm js= directly onto the existing .click(fn=_btn_generating)
call instead of chaining a standalone fn=None step after it. This
removes the untested fn=None/non-queued link from the chain entirely
rather than trying to fix its behavior.

Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -3161,11 +3161,7 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
3161
  fn=_btn_generating,
3162
  inputs=None,
3163
  outputs=[taro_btn],
3164
- ).then(
3165
- fn=None,
3166
- inputs=[],
3167
- outputs=[],
3168
- js="() => window._armGenerateWatchdog('taro_btn', 600000)",
3169
  ).then(
3170
  fn=_run_taro,
3171
  inputs=[taro_video, taro_seed, taro_cfg, taro_steps, taro_mode,
@@ -3232,11 +3228,7 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
3232
  fn=_btn_generating,
3233
  inputs=None,
3234
  outputs=[mma_btn],
3235
- ).then(
3236
- fn=None,
3237
- inputs=[],
3238
- outputs=[],
3239
- js="() => window._armGenerateWatchdog('mma_btn', 600000)",
3240
  ).then(
3241
  fn=_run_mmaudio,
3242
  inputs=[mma_video, mma_prompt, mma_neg, mma_seed,
@@ -3302,11 +3294,7 @@ with gr.Blocks(title="Generate Audio for Video", css=_SLOT_CSS, js=_GLOBAL_JS) a
3302
  fn=_btn_generating,
3303
  inputs=None,
3304
  outputs=[hf_btn],
3305
- ).then(
3306
- fn=None,
3307
- inputs=[],
3308
- outputs=[],
3309
- js="() => window._armGenerateWatchdog('hf_btn', 600000)",
3310
  ).then(
3311
  fn=_run_hunyuan,
3312
  inputs=[hf_video, hf_prompt, hf_neg, hf_seed,
 
3161
  fn=_btn_generating,
3162
  inputs=None,
3163
  outputs=[taro_btn],
3164
+ js="() => { window._armGenerateWatchdog('taro_btn', 600000); }",
 
 
 
 
3165
  ).then(
3166
  fn=_run_taro,
3167
  inputs=[taro_video, taro_seed, taro_cfg, taro_steps, taro_mode,
 
3228
  fn=_btn_generating,
3229
  inputs=None,
3230
  outputs=[mma_btn],
3231
+ js="() => { window._armGenerateWatchdog('mma_btn', 600000); }",
 
 
 
 
3232
  ).then(
3233
  fn=_run_mmaudio,
3234
  inputs=[mma_video, mma_prompt, mma_neg, mma_seed,
 
3294
  fn=_btn_generating,
3295
  inputs=None,
3296
  outputs=[hf_btn],
3297
+ js="() => { window._armGenerateWatchdog('hf_btn', 600000); }",
 
 
 
 
3298
  ).then(
3299
  fn=_run_hunyuan,
3300
  inputs=[hf_video, hf_prompt, hf_neg, hf_seed,