Ricercar commited on
Commit
38c92eb
1 Parent(s): 7ce7d8f

small refresh logic change

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. pages/Gallery.py +8 -9
.gitignore CHANGED
@@ -8,3 +8,4 @@ Thumbs.db
8
  secret.sh
9
 
10
  .idea/
 
 
8
  secret.sh
9
 
10
  .idea/
11
+ playgrounds/
pages/Gallery.py CHANGED
@@ -362,12 +362,9 @@ class GalleryApp:
362
  # else:
363
  # checked = False
364
 
365
- selection_control_button = st.empty()
366
- report_control_button = st.empty()
367
-
368
  if image_status == 'report':
369
  st.warning('You have reported this image')
370
- unreport = report_control_button.form_submit_button('Withdraw report', use_container_width=True, type='secondary', on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'deselect'))
371
 
372
  else:
373
  if image_status is None:
@@ -377,19 +374,21 @@ class GalleryApp:
377
 
378
  if image_status == 'select' or image_status == 'reselect' or image_status is None:
379
  # deselect = st.button('Deselect', key=f'select_{item["prompt_id"]}_{item["modelVersion_id"]}', use_container_width=True)
380
- deselect = selection_control_button.form_submit_button('Deselect', use_container_width=True, on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'deselect'))
381
 
382
- st.info(
383
- "Image selected. **Click 'Check out selections ➡️' on top to see all selected images**.")
384
 
385
  elif image_status =='deselect':
386
  # select = st.button('Select', key=f'select_{item["prompt_id"]}_{item["modelVersion_id"]}', use_container_width=True, type='primary')
387
- reselect = selection_control_button.form_submit_button('Reselect', use_container_width=True, type='primary', on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'reselect'))
388
 
389
- report = report_control_button.form_submit_button('⚠️Report', use_container_width=True, type='secondary',
390
  on_click=self.image_selection_control, args=(
391
  item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'report'))
392
 
 
 
 
 
393
  # st.write(item)
394
  # infos = ['model_name', 'modelVersion_name', 'model_download_count', 'clip_score', 'mcos_score',
395
  # 'nsfw_score']
 
362
  # else:
363
  # checked = False
364
 
 
 
 
365
  if image_status == 'report':
366
  st.warning('You have reported this image')
367
+ unreport = st.form_submit_button('Withdraw report', use_container_width=True, type='secondary', on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'deselect'))
368
 
369
  else:
370
  if image_status is None:
 
374
 
375
  if image_status == 'select' or image_status == 'reselect' or image_status is None:
376
  # deselect = st.button('Deselect', key=f'select_{item["prompt_id"]}_{item["modelVersion_id"]}', use_container_width=True)
377
+ deselect = st.form_submit_button('Deselect', use_container_width=True, on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'deselect'))
378
 
 
 
379
 
380
  elif image_status =='deselect':
381
  # select = st.button('Select', key=f'select_{item["prompt_id"]}_{item["modelVersion_id"]}', use_container_width=True, type='primary')
382
+ reselect = st.form_submit_button('Reselect', use_container_width=True, type='primary', on_click=self.image_selection_control, args=(item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'reselect'))
383
 
384
+ report = st.form_submit_button('⚠️Report', use_container_width=True, type='secondary',
385
  on_click=self.image_selection_control, args=(
386
  item['tag'], item['prompt'], item['prompt_id'], item['modelVersion_id'], 'report'))
387
 
388
+ if image_status == 'select' or image_status == 'reselect' or image_status is None:
389
+ st.info(
390
+ "Image selected. **Click 'Check out selections ➡️' on top to see all selected images**.")
391
+
392
  # st.write(item)
393
  # infos = ['model_name', 'modelVersion_name', 'model_download_count', 'clip_score', 'mcos_score',
394
  # 'nsfw_score']