Siddartha10 commited on
Commit
cb5b3a1
·
verified ·
1 Parent(s): 2fdb7f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -123,8 +123,9 @@ from langchain.vectorstores import FAISS
123
  def get_vectorstore(text_chunks):
124
  # Check if the FAISS index file already exists
125
  if os.path.exists("faiss_index"):
 
126
  # Load the existing FAISS index
127
- vectorstore = FAISS.load_local("faiss_index")
128
  print("Loaded existing FAISS index.")
129
  else:
130
  # Create a new FAISS index
 
123
  def get_vectorstore(text_chunks):
124
  # Check if the FAISS index file already exists
125
  if os.path.exists("faiss_index"):
126
+ embeddings = OpenAIEmbeddings()
127
  # Load the existing FAISS index
128
+ vectorstore = FAISS.load_local("faiss_index", embeddings)
129
  print("Loaded existing FAISS index.")
130
  else:
131
  # Create a new FAISS index