Plsek commited on
Commit
1e9a66f
·
1 Parent(s): f0ad674

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -153,10 +153,6 @@ def reset_threshold():
153
  # del st.session_state["threshold"]
154
  st.session_state['threshold'] = 0.0
155
  # st.session_state['example'] = False
156
-
157
- #@st.cache #_data
158
- def set_example():
159
- st.session_state['example'] = True
160
 
161
  # Load model
162
  model = load_CADET()
@@ -213,6 +209,10 @@ with col_2:
213
  # uploaded_file = "NGC5813_example.fits"
214
 
215
  # If file is uploaded, read in the data and plot it
 
 
 
 
216
 
217
  if uploaded_file is not None:
218
  fname = uploaded_file.name.strip(".fits")
@@ -226,6 +226,7 @@ if st.session_state["example"]:
226
  fname = "NGC4649_example"
227
  os.system(f'mkdir -p {fname}')
228
  data, wcs = load_file(f"{fname}.fits")
 
229
 
230
  if "data" not in locals():
231
  data, wcs = np.ones((128,128)) * (-1), None
 
153
  # del st.session_state["threshold"]
154
  st.session_state['threshold'] = 0.0
155
  # st.session_state['example'] = False
 
 
 
 
156
 
157
  # Load model
158
  model = load_CADET()
 
209
  # uploaded_file = "NGC5813_example.fits"
210
 
211
  # If file is uploaded, read in the data and plot it
212
+
213
+
214
+ if 'example' not in st.session_state:
215
+ st.session_state['example'] = False
216
 
217
  if uploaded_file is not None:
218
  fname = uploaded_file.name.strip(".fits")
 
226
  fname = "NGC4649_example"
227
  os.system(f'mkdir -p {fname}')
228
  data, wcs = load_file(f"{fname}.fits")
229
+ st.session_state['example'] = True
230
 
231
  if "data" not in locals():
232
  data, wcs = np.ones((128,128)) * (-1), None