cxumol commited on
Commit
64b6fe3
·
unverified ·
1 Parent(s): e91fdc8

add cancel_btn

Browse files
Files changed (1) hide show
  1. app/app.py +5 -1
app/app.py CHANGED
@@ -279,6 +279,9 @@ with gr.Blocks(
279
  type="filepath",
280
  )
281
  infer_btn = gr.Button("Go!", variant="primary")
 
 
 
282
  gr.Markdown("#### Like it? Give me a star ⭐ [on GitHub](https://github.com/cxumol/CoverPilot)!")
283
 
284
  is_same_cheap_strong.change(
@@ -320,7 +323,7 @@ with gr.Blocks(
320
  outputs=[setup_zone],
321
  )
322
 
323
- infer_btn.click(
324
  fn=set_same_cheap_strong,
325
  inputs=[
326
  is_same_cheap_strong,
@@ -380,6 +383,7 @@ with gr.Blocks(
380
  ],
381
  outputs=[debug_jobapp, cover_letter_pdf],
382
  )
 
383
 
384
 
385
  if __name__ == "__main__":
 
279
  type="filepath",
280
  )
281
  infer_btn = gr.Button("Go!", variant="primary")
282
+ with gr.Row():
283
+ cancel_btn = gr.Button("Cancel", variant="secondary")
284
+ regen_pdf_btn = gr.Button("Re-generate PDF", variant="secondary")
285
  gr.Markdown("#### Like it? Give me a star ⭐ [on GitHub](https://github.com/cxumol/CoverPilot)!")
286
 
287
  is_same_cheap_strong.change(
 
323
  outputs=[setup_zone],
324
  )
325
 
326
+ main_click_event = infer_btn.click(
327
  fn=set_same_cheap_strong,
328
  inputs=[
329
  is_same_cheap_strong,
 
383
  ],
384
  outputs=[debug_jobapp, cover_letter_pdf],
385
  )
386
+ cancel_btn.click(fn=None, inputs=None, outputs=None, cancels=[main_click_event])
387
 
388
 
389
  if __name__ == "__main__":