Zekun Wu
commited on
Commit
•
5485067
1
Parent(s):
8766924
update
Browse files- pages/2_batch_evaluation.py +13 -10
pages/2_batch_evaluation.py
CHANGED
@@ -5,15 +5,18 @@ import os
|
|
5 |
|
6 |
|
7 |
def check_password():
|
8 |
-
|
9 |
-
password_input
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
def batch_evaluate(uploaded_file):
|
@@ -44,7 +47,7 @@ def batch_evaluate(uploaded_file):
|
|
44 |
|
45 |
st.title('Natural Language Explanation Demo')
|
46 |
|
47 |
-
if
|
48 |
check_password()
|
49 |
else:
|
50 |
st.sidebar.success("Password Verified. Proceed with the demo.")
|
|
|
5 |
|
6 |
|
7 |
def check_password():
|
8 |
+
def password_entered():
|
9 |
+
if password_input == os.getenv('PASSWORD'):
|
10 |
+
st.session_state['password_correct'] = True
|
11 |
+
else:
|
12 |
+
st.error("Incorrect Password, please try again.")
|
13 |
+
|
14 |
+
password_input = st.text_input("Enter Password:", type="password")
|
15 |
+
submit_button = st.button("Submit", on_click=password_entered)
|
16 |
+
|
17 |
+
if submit_button and not st.session_state.get('password_correct', False):
|
18 |
+
st.error("Please enter a valid password to access the demo.")
|
19 |
+
|
20 |
|
21 |
|
22 |
def batch_evaluate(uploaded_file):
|
|
|
47 |
|
48 |
st.title('Natural Language Explanation Demo')
|
49 |
|
50 |
+
if not st.session_state.get('password_correct', False):
|
51 |
check_password()
|
52 |
else:
|
53 |
st.sidebar.success("Password Verified. Proceed with the demo.")
|