Zekun Wu
commited on
Commit
·
f60efdc
1
Parent(s):
e6cbfc2
update
Browse files- pages/2_Benchmark_Data.py +10 -15
pages/2_Benchmark_Data.py
CHANGED
|
@@ -10,28 +10,23 @@ Once verified, you can specify the number of samples you wish to retrieve and do
|
|
| 10 |
""")
|
| 11 |
|
| 12 |
|
| 13 |
-
def
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
"""
|
| 18 |
-
|
| 19 |
-
def on_password_entered():
|
| 20 |
-
if password_input == os.getenv('DEMO_PASSWORD'):
|
| 21 |
-
st.session_state['password_verified'] = True
|
| 22 |
else:
|
| 23 |
-
st.error("Incorrect
|
| 24 |
|
| 25 |
password_input = st.text_input("Enter Password:", type="password")
|
| 26 |
-
submit_button = st.button("Submit", on_click=
|
| 27 |
|
| 28 |
-
if submit_button and not st.session_state.get('
|
| 29 |
st.error("Please enter a valid password to access the demo.")
|
| 30 |
|
| 31 |
|
| 32 |
-
|
| 33 |
-
if not st.session_state.get('
|
| 34 |
-
|
| 35 |
else:
|
| 36 |
st.sidebar.success("Password Verified. Proceed with the demo.")
|
| 37 |
|
|
|
|
| 10 |
""")
|
| 11 |
|
| 12 |
|
| 13 |
+
def check_password():
|
| 14 |
+
def password_entered():
|
| 15 |
+
if password_input == os.getenv('PASSWORD'):
|
| 16 |
+
st.session_state['password_correct'] = True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
else:
|
| 18 |
+
st.error("Incorrect Password, please try again.")
|
| 19 |
|
| 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 |
|
| 27 |
+
|
| 28 |
+
if not st.session_state.get('password_correct', False):
|
| 29 |
+
check_password()
|
| 30 |
else:
|
| 31 |
st.sidebar.success("Password Verified. Proceed with the demo.")
|
| 32 |
|