Update app.py
Browse files
app.py
CHANGED
@@ -227,22 +227,22 @@ init_messages = {
|
|
227 |
}
|
228 |
|
229 |
# Embed and store the first N supports for this demo
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
|
233 |
-
|
234 |
-
ids=[str(i) for i in range(0, L)], # IDs are just strings
|
235 |
-
documents=dataset["train"]["questions"], # Enter questions here
|
236 |
-
metadatas=[{"type": "support"} for _ in range(0, L)],
|
237 |
-
)
|
238 |
-
|
239 |
-
if st.session_state.curr_domain != domain:
|
240 |
-
st.session_state.messages = []
|
241 |
-
|
242 |
-
init_message = init_messages[domain]
|
243 |
-
st.session_state.messages.append({"role": "assistant", "content": init_message})
|
244 |
-
|
245 |
-
st.session_state.curr_domain = domain
|
246 |
|
247 |
# Display chat messages from history on app rerun
|
248 |
for message in st.session_state.messages:
|
|
|
227 |
}
|
228 |
|
229 |
# Embed and store the first N supports for this demo
|
230 |
+
with st.spinner("Loading, please be patient with us ... 🙏"):
|
231 |
+
L = len(dataset["train"]["questions"])
|
232 |
+
|
233 |
+
collection.add(
|
234 |
+
ids=[str(i) for i in range(0, L)], # IDs are just strings
|
235 |
+
documents=dataset["train"]["questions"], # Enter questions here
|
236 |
+
metadatas=[{"type": "support"} for _ in range(0, L)],
|
237 |
+
)
|
238 |
+
|
239 |
+
if st.session_state.curr_domain != domain:
|
240 |
+
st.session_state.messages = []
|
241 |
+
|
242 |
+
init_message = init_messages[domain]
|
243 |
+
st.session_state.messages.append({"role": "assistant", "content": init_message})
|
244 |
|
245 |
+
st.session_state.curr_domain = domain
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
|
247 |
# Display chat messages from history on app rerun
|
248 |
for message in st.session_state.messages:
|