chanicpanic commited on
Commit
965645e
·
1 Parent(s): 1123a4e

Maintain save_image state across modality switches

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. search.py +2 -1
app.py CHANGED
@@ -26,6 +26,9 @@ if "grascii" not in st.session_state:
26
  if "alternatives" not in st.session_state:
27
  st.session_state["alternatives"] = {}
28
 
 
 
 
29
  if st.session_state["report_submitted"]:
30
  st.toast("Thanks for the report!")
31
  st.session_state["report_submitted"] = False
 
26
  if "alternatives" not in st.session_state:
27
  st.session_state["alternatives"] = {}
28
 
29
+ if "save_image" in st.session_state:
30
+ st.session_state["save_image"] = st.session_state["save_image"]
31
+
32
  if st.session_state["report_submitted"]:
33
  st.toast("Thanks for the report!")
34
  st.session_state["report_submitted"] = False
search.py CHANGED
@@ -70,7 +70,8 @@ def write_grascii_search():
70
  """,
71
  )
72
  save = st.checkbox(
73
- "Save images I upload for potential inclusion in open-source datasets used to train and improve models"
 
74
  )
75
 
76
  if image_data:
 
70
  """,
71
  )
72
  save = st.checkbox(
73
+ "Save images I upload for potential inclusion in open-source datasets used to train and improve models",
74
+ key="save_image",
75
  )
76
 
77
  if image_data: