Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,15 +41,15 @@ authenticator = stauth.Authenticate(
|
|
41 |
config['cookie']['expiry_days']
|
42 |
)
|
43 |
|
44 |
-
#
|
45 |
-
name, authentication_status, username = authenticator.login('Login')
|
46 |
|
47 |
if not authentication_status:
|
48 |
st.error('Authentication failed. Please refresh and try again.')
|
49 |
st.stop()
|
50 |
|
51 |
st.sidebar.write(f"Welcome *{name}*")
|
52 |
-
authenticator.logout('Logout')
|
53 |
|
54 |
# ------------------------------
|
55 |
# Load Models
|
@@ -132,7 +132,7 @@ with tabs[1]:
|
|
132 |
answer = answer_question(summary_context, question)
|
133 |
st.subheader("Answer")
|
134 |
st.write(answer)
|
135 |
-
# For session saving, one could store Q&A pairs in st.session_state or database.
|
136 |
else:
|
137 |
st.warning("Please provide both a summary context and a question.")
|
138 |
|
|
|
41 |
config['cookie']['expiry_days']
|
42 |
)
|
43 |
|
44 |
+
# Use 'sidebar' as the location parameter for authentication
|
45 |
+
name, authentication_status, username = authenticator.login('Login', 'sidebar')
|
46 |
|
47 |
if not authentication_status:
|
48 |
st.error('Authentication failed. Please refresh and try again.')
|
49 |
st.stop()
|
50 |
|
51 |
st.sidebar.write(f"Welcome *{name}*")
|
52 |
+
authenticator.logout('Logout', 'sidebar')
|
53 |
|
54 |
# ------------------------------
|
55 |
# Load Models
|
|
|
132 |
answer = answer_question(summary_context, question)
|
133 |
st.subheader("Answer")
|
134 |
st.write(answer)
|
135 |
+
# For session saving, one could store Q&A pairs in st.session_state or a database.
|
136 |
else:
|
137 |
st.warning("Please provide both a summary context and a question.")
|
138 |
|