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

add force refresh

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -220,7 +220,7 @@ class GalleryApp:
220
  sub_selecters = st.columns([1, 1, 1, 1])
221
 
222
  if 'default_weights' not in st.session_state:
223
- st.session_state.default_weights = [1.0, 1.0, 1.0]
224
 
225
  with sub_selecters[0]:
226
  clip_weight = st.number_input('Clip Score Weight', min_value=-100.0, max_value=100.0, value=st.session_state.default_weights[0], step=0.1, help='the weight for normalized clip score')
@@ -374,12 +374,15 @@ 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
 
378
- gallery_place = st.empty()
379
-
380
- with gallery_place.container():
381
  self.gallery_standard(items, col_num, info)
382
 
 
 
 
383
  # with st.form(key=f'{prompt_id}', clear_on_submit=True):
384
  # buttons = st.columns([1, 1, 1])
385
  # with buttons[0]:
 
220
  sub_selecters = st.columns([1, 1, 1, 1])
221
 
222
  if 'default_weights' not in st.session_state:
223
+ st.session_state.default_weights = [1.0, 0.8, 0.2]
224
 
225
  with sub_selecters[0]:
226
  clip_weight = st.number_input('Clip Score Weight', min_value=-100.0, max_value=100.0, value=st.session_state.default_weights[0], step=0.1, help='the weight for normalized clip score')
 
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]: