Spaces:
Sleeping
Sleeping
spinner organized
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ collection = client.create_collection(combined_string)
|
|
86 |
|
87 |
|
88 |
# Embed and store the first N supports for this demo
|
89 |
-
with st.spinner("Loading
|
90 |
L = len(dataset["train"]["questions"])
|
91 |
collection.add(
|
92 |
ids=[str(i) for i in range(0, L)], # IDs are just strings
|
@@ -97,13 +97,13 @@ with st.spinner("Loading database, please be patient with us ... π"):
|
|
97 |
|
98 |
# React to user input
|
99 |
if prompt := st.chat_input("Tell me about YSA"):
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
104 |
|
105 |
-
|
106 |
-
with st.spinner("Thinking ..."):
|
107 |
results = collection.query(query_texts=question, n_results=5)
|
108 |
idx = results["ids"][0]
|
109 |
idx = [int(i) for i in idx]
|
|
|
86 |
|
87 |
|
88 |
# Embed and store the first N supports for this demo
|
89 |
+
with st.spinner("Loading, please be patient with us ... π"):
|
90 |
L = len(dataset["train"]["questions"])
|
91 |
collection.add(
|
92 |
ids=[str(i) for i in range(0, L)], # IDs are just strings
|
|
|
97 |
|
98 |
# React to user input
|
99 |
if prompt := st.chat_input("Tell me about YSA"):
|
100 |
+
with st.spinner("Loading, please be patient with us ... π"):
|
101 |
+
# Display user message in chat message container
|
102 |
+
st.chat_message("user").markdown(prompt)
|
103 |
+
# Add user message to chat history
|
104 |
+
st.session_state.messages.append({"role": "user", "content": prompt})
|
105 |
|
106 |
+
question = prompt
|
|
|
107 |
results = collection.query(query_texts=question, n_results=5)
|
108 |
idx = results["ids"][0]
|
109 |
idx = [int(i) for i in idx]
|