Update app.py
Browse files
app.py
CHANGED
|
@@ -35,8 +35,8 @@ def get_text_chunks(text):
|
|
| 35 |
# Creates and saves a FAISS vector store from text chunks
|
| 36 |
def get_vector_store(text_chunks):
|
| 37 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 38 |
-
FAISS.deserialize_from_bytes(text_chunks, embeddings, allow_dangerous_deserialization=True)
|
| 39 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
|
|
|
| 40 |
vector_store.save_local("faiss_index")
|
| 41 |
|
| 42 |
# Creates and returns a conversational chain for question answering
|
|
|
|
| 35 |
# Creates and saves a FAISS vector store from text chunks
|
| 36 |
def get_vector_store(text_chunks):
|
| 37 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
|
|
|
| 38 |
vector_store = FAISS.from_texts(text_chunks, embedding=embeddings)
|
| 39 |
+
FAISS.deserialize_from_bytes(vector_store, embeddings, allow_dangerous_deserialization=True)
|
| 40 |
vector_store.save_local("faiss_index")
|
| 41 |
|
| 42 |
# Creates and returns a conversational chain for question answering
|