Spaces:
Sleeping
Sleeping
Update src/helper_functions.py
Browse files- src/helper_functions.py +0 -36
src/helper_functions.py
CHANGED
@@ -11,42 +11,6 @@ from datetime import datetime
|
|
11 |
import regex
|
12 |
import os
|
13 |
|
14 |
-
|
15 |
-
def check_password():
|
16 |
-
def password_entered():
|
17 |
-
if st.session_state["password"] == os.getenv("APP_PASSWORD"):
|
18 |
-
st.session_state["password_correct"] = True
|
19 |
-
del st.session_state["password"]
|
20 |
-
else:
|
21 |
-
st.session_state["password_correct"] = False
|
22 |
-
|
23 |
-
if "password_correct" not in st.session_state:
|
24 |
-
st.markdown("\n\n")
|
25 |
-
st.text_input(
|
26 |
-
"Enter the password",
|
27 |
-
type="password",
|
28 |
-
on_change=password_entered,
|
29 |
-
key="password",
|
30 |
-
)
|
31 |
-
st.divider()
|
32 |
-
st.info("Designed and developed by Milan Mrdenovic © IBM Norway 2025")
|
33 |
-
return False
|
34 |
-
elif not st.session_state["password_correct"]:
|
35 |
-
st.markdown("\n\n")
|
36 |
-
st.text_input(
|
37 |
-
"Enter the password",
|
38 |
-
type="password",
|
39 |
-
on_change=password_entered,
|
40 |
-
key="password",
|
41 |
-
)
|
42 |
-
st.divider()
|
43 |
-
st.info("Designed and developed by Milan Mrdenovic © IBM Norway 2025")
|
44 |
-
st.error("😕 Password incorrect")
|
45 |
-
return False
|
46 |
-
else:
|
47 |
-
return True
|
48 |
-
|
49 |
-
|
50 |
def initialize_session_state():
|
51 |
if "chat_history" not in st.session_state:
|
52 |
st.session_state.chat_history = []
|
|
|
11 |
import regex
|
12 |
import os
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
def initialize_session_state():
|
15 |
if "chat_history" not in st.session_state:
|
16 |
st.session_state.chat_history = []
|