Spaces:
Running
Running
Erva Ulusoy
commited on
Commit
·
e021e3c
1
Parent(s):
e8c701e
enable sidebar after predictions are made
Browse files- ProtHGT_app.py +12 -5
ProtHGT_app.py
CHANGED
@@ -42,9 +42,16 @@ if 'previous_inputs' not in st.session_state:
|
|
42 |
if 'generating_predictions' not in st.session_state:
|
43 |
st.session_state.generating_predictions = False
|
44 |
|
45 |
-
def
|
46 |
-
st.session_state.generating_predictions =
|
47 |
-
st.session_state.submitted =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
with st.expander("🚀 Upcoming Features"):
|
50 |
st.info("""
|
@@ -249,7 +256,7 @@ with st.sidebar:
|
|
249 |
if st.button("Generate Predictions",
|
250 |
disabled=button_disabled,
|
251 |
key="generate_predictions",
|
252 |
-
on_click=set_generating_predictions):
|
253 |
pass
|
254 |
|
255 |
# Create a tuple of current inputs to track changes
|
@@ -312,7 +319,7 @@ if st.session_state.submitted:
|
|
312 |
|
313 |
st.session_state.predictions_df = predictions_df
|
314 |
|
315 |
-
|
316 |
|
317 |
# Display and filter predictions
|
318 |
st.success("Predictions generated successfully!")
|
|
|
42 |
if 'generating_predictions' not in st.session_state:
|
43 |
st.session_state.generating_predictions = False
|
44 |
|
45 |
+
def reset_prediction_state():
|
46 |
+
st.session_state.generating_predictions = False
|
47 |
+
st.session_state.submitted = False
|
48 |
+
st.session_state.predictions_df = None
|
49 |
+
st.session_state.previous_inputs = None
|
50 |
+
|
51 |
+
|
52 |
+
def set_generating_predictions(flag):
|
53 |
+
st.session_state.generating_predictions = flag
|
54 |
+
st.session_state.submitted = flag
|
55 |
|
56 |
with st.expander("🚀 Upcoming Features"):
|
57 |
st.info("""
|
|
|
256 |
if st.button("Generate Predictions",
|
257 |
disabled=button_disabled,
|
258 |
key="generate_predictions",
|
259 |
+
on_click=set_generating_predictions(True)):
|
260 |
pass
|
261 |
|
262 |
# Create a tuple of current inputs to track changes
|
|
|
319 |
|
320 |
st.session_state.predictions_df = predictions_df
|
321 |
|
322 |
+
set_generating_predictions(False)
|
323 |
|
324 |
# Display and filter predictions
|
325 |
st.success("Predictions generated successfully!")
|