Spaces:
Runtime error
Runtime error
Commit
·
69c1d32
1
Parent(s):
7ba9210
Update app.py
Browse files
app.py
CHANGED
@@ -229,17 +229,19 @@ if len(ALL_FILES) > 0:
|
|
229 |
|
230 |
pass
|
231 |
if count >= 5:
|
|
|
232 |
st.error(f"🐞 File indexing failed{str(e)}")
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
|
|
243 |
|
244 |
# top_k_reader = st.sidebar.slider(
|
245 |
# "Max. number of answers",
|
|
|
229 |
|
230 |
pass
|
231 |
if count >= 5:
|
232 |
+
res = []
|
233 |
st.error(f"🐞 File indexing failed{str(e)}")
|
234 |
|
235 |
+
if len(res) > 0:
|
236 |
+
embeds = [record["embedding"] for record in res["data"]]
|
237 |
+
# get metadata
|
238 |
+
meta = [doc.meta for doc in docs[i:i_end]]
|
239 |
+
# create unique IDs
|
240 |
+
ids = [doc.id for doc in docs[i:i_end]]
|
241 |
+
# add all to upsert list
|
242 |
+
to_upsert = list(zip(ids, embeds, meta))
|
243 |
+
# upsert/insert these records to pinecone
|
244 |
+
_ = index.upsert(vectors=to_upsert)
|
245 |
|
246 |
# top_k_reader = st.sidebar.slider(
|
247 |
# "Max. number of answers",
|