ujaganna commited on
Commit
6f6a838
·
verified ·
1 Parent(s): 35072c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -35,7 +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
- vector_store = FAISS.from_texts(text_chunks, embedding=embeddings, allow_dangerous_deserialization=True)
 
39
  vector_store.save_local("faiss_index")
40
 
41
  # 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
+ FAISS.deserialize_from_bytes(serialized_data, 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