Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,12 +73,14 @@ def update_vectors(files, parser):
|
|
73 |
embed = get_embeddings()
|
74 |
total_chunks = 0
|
75 |
|
76 |
-
|
77 |
for file in files:
|
78 |
data = load_document(file, parser)
|
79 |
all_data.extend(data)
|
80 |
total_chunks += len(data)
|
81 |
-
|
|
|
|
|
82 |
|
83 |
if os.path.exists("faiss_database"):
|
84 |
database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
|
|
|
73 |
embed = get_embeddings()
|
74 |
total_chunks = 0
|
75 |
|
76 |
+
new_documents = []
|
77 |
for file in files:
|
78 |
data = load_document(file, parser)
|
79 |
all_data.extend(data)
|
80 |
total_chunks += len(data)
|
81 |
+
new_documents.append({"name": file.name, "selected": True})
|
82 |
+
|
83 |
+
uploaded_documents.extend(new_documents)
|
84 |
|
85 |
if os.path.exists("faiss_database"):
|
86 |
database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
|