ndebuhr commited on
Commit
7894bef
1 Parent(s): 2b6fecd

Update the Generate button value and interactivity to clarify when the system is generating

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -354,6 +354,8 @@ with gr.Blocks() as demo:
354
  }
355
 
356
  generate_btn.click(
 
 
357
  generate,
358
  inputs=prompt_inputs,
359
  outputs=[generate_btn, generations_col, generations_grp, reveal_btn]
@@ -402,7 +404,7 @@ with gr.Blocks() as demo:
402
  detections_col: gr.Column(visible=False),
403
  revealed_grp: gr.CheckboxGroup(visible=False),
404
  reset_btn: gr.Button(visible=False),
405
- generate_btn: gr.Button(visible=True),
406
  }
407
 
408
  reset_btn.click(
 
354
  }
355
 
356
  generate_btn.click(
357
+ lambda: gr.update(value='Generating...', interactive=False), None, generate_btn
358
+ ).then(
359
  generate,
360
  inputs=prompt_inputs,
361
  outputs=[generate_btn, generations_col, generations_grp, reveal_btn]
 
404
  detections_col: gr.Column(visible=False),
405
  revealed_grp: gr.CheckboxGroup(visible=False),
406
  reset_btn: gr.Button(visible=False),
407
+ generate_btn: gr.Button(value='Generate', interactive=True, visible=True),
408
  }
409
 
410
  reset_btn.click(