Pamudu13 commited on
Commit
2e84d85
·
verified ·
1 Parent(s): a0d55b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -34,7 +34,10 @@ def extract_text_from_pdf(pdf_stream):
34
  def create_vector_db(text_chunks):
35
  """Embeds text chunks and adds them to FAISS index"""
36
  global documents, index
37
-
 
 
 
38
  documents = text_chunks
39
  embeddings = embed_model.encode(text_chunks)
40
 
 
34
  def create_vector_db(text_chunks):
35
  """Embeds text chunks and adds them to FAISS index"""
36
  global documents, index
37
+
38
+ # Reinitialize the FAISS index
39
+ index = faiss.IndexFlatL2(vector_dim)
40
+
41
  documents = text_chunks
42
  embeddings = embed_model.encode(text_chunks)
43