Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def get_text():
|
|
40 |
if 'key' not in st.session_state:
|
41 |
st.session_state['key'] = st.text_input("key: ", key="input1")
|
42 |
|
43 |
-
|
44 |
user_input = get_text()
|
45 |
if user_input:
|
46 |
prompt = 'The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.'
|
@@ -59,5 +59,5 @@ if st.session_state['key'] == st.secrets["login_key"]:
|
|
59 |
for i in range(len(st.session_state['generated'])-1, -1, -1):
|
60 |
message(st.session_state["generated"][i], key=str(i))
|
61 |
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
|
62 |
-
|
63 |
st.warning('wrong key!')
|
|
|
40 |
if 'key' not in st.session_state:
|
41 |
st.session_state['key'] = st.text_input("key: ", key="input1")
|
42 |
|
43 |
+
elif st.session_state['key'] == st.secrets["login_key"]:
|
44 |
user_input = get_text()
|
45 |
if user_input:
|
46 |
prompt = 'The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.'
|
|
|
59 |
for i in range(len(st.session_state['generated'])-1, -1, -1):
|
60 |
message(st.session_state["generated"][i], key=str(i))
|
61 |
message(st.session_state['past'][i], is_user=True, key=str(i) + '_user')
|
62 |
+
elif st.session_state['key'] != st.secrets["login_key"]:
|
63 |
st.warning('wrong key!')
|