Ricercar commited on
Commit
ab37b94
·
1 Parent(s): bc72510

add force refresh

Browse files
Files changed (1) hide show
  1. app.py +17 -19
app.py CHANGED
@@ -374,25 +374,23 @@ class GalleryApp:
374
  if safety_check:
375
  items, info, col_num = self.selection_panel_2(items)
376
  # self.gallery_standard(items, col_num, info)
377
- buttons_space = st.container()
378
- gallery_space = st.empty()
379
-
380
- with gallery_space.container():
381
- self.gallery_standard(items, col_num, info)
382
-
383
- with buttons_space:
384
- st.button('Refresh', on_click=gallery_space.empty, use_container_width=True, type='primary')
385
-
386
- # with st.form(key=f'{prompt_id}', clear_on_submit=True):
387
- # buttons = st.columns([1, 1, 1])
388
- # with buttons[0]:
389
- # submit = st.form_submit_button('Save selections', on_click=self.save_checked, use_container_width=True, type='primary')
390
- # with buttons[1]:
391
- # submit = st.form_submit_button('Reset current prompt', on_click=self.reset_current_prompt, kwargs={'prompt_id': prompt_id} , use_container_width=True)
392
- # with buttons[2]:
393
- # submit = st.form_submit_button('Reset all selections', on_click=self.reset_all, use_container_width=True)
394
- #
395
- # self.gallery_standard(items, col_num, info)
396
 
397
  def reset_current_prompt(self, prompt_id):
398
  # reset current prompt
 
374
  if safety_check:
375
  items, info, col_num = self.selection_panel_2(items)
376
  # self.gallery_standard(items, col_num, info)
377
+
378
+ with st.form(key=f'{prompt_id}', clear_on_submit=True):
379
+ # buttons = st.columns([1, 1, 1])
380
+ buttons_space = st.container()
381
+ gallery_space = st.empty()
382
+ # with buttons[0]:
383
+ # submit = st.form_submit_button('Save selections', on_click=self.save_checked, use_container_width=True, type='primary')
384
+ # with buttons[1]:
385
+ # submit = st.form_submit_button('Reset current prompt', on_click=self.reset_current_prompt, kwargs={'prompt_id': prompt_id} , use_container_width=True)
386
+ # with buttons[2]:
387
+ # submit = st.form_submit_button('Reset all selections', on_click=self.reset_all, use_container_width=True)
388
+
389
+ with gallery_space.container():
390
+ self.gallery_standard(items, col_num, info)
391
+
392
+ with buttons_space:
393
+ st.form_submit_button('Refresh', on_click=gallery_space.empty, use_container_width=True, type='primary')
 
 
394
 
395
  def reset_current_prompt(self, prompt_id):
396
  # reset current prompt