Update app.py
Browse files
app.py
CHANGED
@@ -164,7 +164,7 @@ col1.write(f"**You:** {user_input}")
|
|
164 |
ask = col2.button("Ask", type="primary")
|
165 |
|
166 |
if ask:
|
167 |
-
if api_key
|
168 |
st.write(f"**{BOOK_NAME}:** Whoops looks like you forgot your API key buddy. We throw a dice to decide wether you can ask one question for free.")
|
169 |
# stop with a prob = 0.9
|
170 |
if random() > 1/6:
|
@@ -181,7 +181,7 @@ if ask:
|
|
181 |
if 'key' in st.session_state:
|
182 |
msg = "Just one sec"
|
183 |
else:
|
184 |
-
msg = "Um... excuse me but... this can take about a minute for your first question because some stuff
|
185 |
st.session_state.key = 'value'
|
186 |
# ns.counter = 1
|
187 |
with st.spinner(msg):
|
|
|
164 |
ask = col2.button("Ask", type="primary")
|
165 |
|
166 |
if ask:
|
167 |
+
if not api_key:
|
168 |
st.write(f"**{BOOK_NAME}:** Whoops looks like you forgot your API key buddy. We throw a dice to decide wether you can ask one question for free.")
|
169 |
# stop with a prob = 0.9
|
170 |
if random() > 1/6:
|
|
|
181 |
if 'key' in st.session_state:
|
182 |
msg = "Just one sec"
|
183 |
else:
|
184 |
+
msg = "Um... excuse me but... this can take about a minute for your first question because some stuff needs to be downloaded π₯Ίππ»ππ»"
|
185 |
st.session_state.key = 'value'
|
186 |
# ns.counter = 1
|
187 |
with st.spinner(msg):
|