Shreyas094 commited on
Commit
f8b2943
·
verified ·
1 Parent(s): 940fa91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -73,12 +73,14 @@ def update_vectors(files, parser):
73
  embed = get_embeddings()
74
  total_chunks = 0
75
 
76
- all_data = []
77
  for file in files:
78
  data = load_document(file, parser)
79
  all_data.extend(data)
80
  total_chunks += len(data)
81
- uploaded_documents.append({"name": file.name, "selected": True})
 
 
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)