Spaces:
Sleeping
Sleeping
Myranda
commited on
Commit
·
5148424
1
Parent(s):
e7374ff
Merge pull request #149 from vanderbilt-data-science/issue-130
Browse files
app.py
CHANGED
@@ -66,13 +66,15 @@ def add_logos():
|
|
66 |
st.image(vu_logo, caption=None, width=200, use_column_width=None,
|
67 |
clamp=False, channels="RGB", output_format="auto")
|
68 |
|
|
|
|
|
|
|
69 |
|
70 |
# Render the login module
|
71 |
-
add_logos()
|
72 |
name, authentication_status, username = authenticator.login('Login', 'main')
|
73 |
-
|
74 |
# If the user is authenticated
|
75 |
if authentication_status:
|
|
|
76 |
authenticator.logout('Logout', 'main', key='unique_key')
|
77 |
st.write(f'Welcome *{name}*')
|
78 |
|
@@ -84,8 +86,7 @@ if authentication_status:
|
|
84 |
user_data = get_user_data(username)
|
85 |
|
86 |
if page == "Account Setup":
|
87 |
-
|
88 |
-
|
89 |
st.title("Account Setup")
|
90 |
st.markdown("Please use this page to provide your OpenAI API Key, Principles and Writing Style. **Please make sure to press the Save Changes button after providing the information.**")
|
91 |
|
@@ -107,7 +108,6 @@ if authentication_status:
|
|
107 |
db.put({"key": username, "principles": principles, "writing_style": writing_style, "api_key": encrypted_api_key})
|
108 |
|
109 |
if page == "API Key Help":
|
110 |
-
add_logos()
|
111 |
|
112 |
st.title("OpenAI API Key Setup")
|
113 |
|
@@ -133,7 +133,6 @@ if authentication_status:
|
|
133 |
st.warning('Treat your API key like a secret! Do not share it publicly.')
|
134 |
|
135 |
elif page == "Respond to Post":
|
136 |
-
add_logos()
|
137 |
st.title("Respond to Post")
|
138 |
|
139 |
left_col, right_col = st.columns(2)
|
|
|
66 |
st.image(vu_logo, caption=None, width=200, use_column_width=None,
|
67 |
clamp=False, channels="RGB", output_format="auto")
|
68 |
|
69 |
+
authentication_status = None
|
70 |
+
if not authentication_status:
|
71 |
+
add_logos()
|
72 |
|
73 |
# Render the login module
|
|
|
74 |
name, authentication_status, username = authenticator.login('Login', 'main')
|
|
|
75 |
# If the user is authenticated
|
76 |
if authentication_status:
|
77 |
+
|
78 |
authenticator.logout('Logout', 'main', key='unique_key')
|
79 |
st.write(f'Welcome *{name}*')
|
80 |
|
|
|
86 |
user_data = get_user_data(username)
|
87 |
|
88 |
if page == "Account Setup":
|
89 |
+
|
|
|
90 |
st.title("Account Setup")
|
91 |
st.markdown("Please use this page to provide your OpenAI API Key, Principles and Writing Style. **Please make sure to press the Save Changes button after providing the information.**")
|
92 |
|
|
|
108 |
db.put({"key": username, "principles": principles, "writing_style": writing_style, "api_key": encrypted_api_key})
|
109 |
|
110 |
if page == "API Key Help":
|
|
|
111 |
|
112 |
st.title("OpenAI API Key Setup")
|
113 |
|
|
|
133 |
st.warning('Treat your API key like a secret! Do not share it publicly.')
|
134 |
|
135 |
elif page == "Respond to Post":
|
|
|
136 |
st.title("Respond to Post")
|
137 |
|
138 |
left_col, right_col = st.columns(2)
|