Spaces:
Sleeping
Sleeping
DataRaptor
commited on
Commit
•
eb16e3f
1
Parent(s):
f101460
Update app.py
Browse files
app.py
CHANGED
@@ -139,4 +139,30 @@ def main():
|
|
139 |
|
140 |
|
141 |
|
142 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
|
141 |
|
142 |
+
def app_viewport():
|
143 |
+
passw = st.empty()
|
144 |
+
appc = st.container()
|
145 |
+
|
146 |
+
if 'logged_in' not in st.session_state:
|
147 |
+
with passw.container():
|
148 |
+
secret = st.text_input('Please Enter Access Code')
|
149 |
+
if st.button("Submit", type='primary'):
|
150 |
+
if secret == st.secrets["login_secret"]:
|
151 |
+
passw.empty()
|
152 |
+
st.session_state['logged_in'] = True
|
153 |
+
else:
|
154 |
+
st.error('Wrong Access Code.')
|
155 |
+
|
156 |
+
if 'logged_in' in st.session_state and st.session_state['logged_in'] == True:
|
157 |
+
with appc:
|
158 |
+
openai.api_key = st.secrets["openai_api"]
|
159 |
+
app()
|
160 |
+
|
161 |
+
|
162 |
+
|
163 |
+
if __name__ == '__main__':
|
164 |
+
main()
|
165 |
+
|
166 |
+
|
167 |
+
|
168 |
+
|