Zekun Wu commited on
Commit
1bf893a
1 Parent(s): 2044f80
Files changed (1) hide show
  1. pages/1_Demo_1.py +5 -8
pages/1_Demo_1.py CHANGED
@@ -20,13 +20,14 @@ def check_password():
20
  password_input = st.text_input("Enter Password:", type="password")
21
  submit_button = st.button("Submit", on_click=password_entered)
22
 
23
- if st.session_state.get('password_correct', False):
24
- load_and_process_data()
25
- else:
26
  st.error("Please enter a valid password to access the demo.")
27
 
 
 
 
 
28
 
29
- def load_and_process_data():
30
  st.subheader('Loading and Processing Data')
31
  st.write('Loading the BOLD dataset...')
32
  bold = load_dataset("AlexaAI/bold", split="train")
@@ -70,7 +71,3 @@ def load_and_process_data():
70
  st.json(regard_results_avg)
71
 
72
 
73
- if __name__ == '__main__':
74
- check_password()
75
-
76
-
 
20
  password_input = st.text_input("Enter Password:", type="password")
21
  submit_button = st.button("Submit", on_click=password_entered)
22
 
23
+ if submit_button and not st.session_state.get('password_correct', False):
 
 
24
  st.error("Please enter a valid password to access the demo.")
25
 
26
+ if not st.session_state.get('password_correct', False):
27
+ check_password()
28
+ else:
29
+ st.sidebar.success("Password Verified. Proceed with the demo.")
30
 
 
31
  st.subheader('Loading and Processing Data')
32
  st.write('Loading the BOLD dataset...')
33
  bold = load_dataset("AlexaAI/bold", split="train")
 
71
  st.json(regard_results_avg)
72
 
73