Spaces:
Running
Running
Update app.py
Browse files
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 |
|