DrishtiSharma commited on
Commit
b66466a
·
verified ·
1 Parent(s): d877997

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -138,12 +138,13 @@ def initialize_vector_store(documents, persist_dir):
138
  embeddings = HuggingFaceEmbeddings()
139
  vectordb = Chroma.from_documents(
140
  documents=documents,
141
- embedding_function=embeddings,
142
  persist_directory=persist_dir
143
  )
144
  vectordb.persist() # Persist the vector store to disk
145
  return vectordb
146
 
 
147
  def create_retriever(vectordb):
148
  """
149
  Create a retriever from the vector store.
 
138
  embeddings = HuggingFaceEmbeddings()
139
  vectordb = Chroma.from_documents(
140
  documents=documents,
141
+ embedding_function=embeddings.embed_query, # Use .embed_query explicitly
142
  persist_directory=persist_dir
143
  )
144
  vectordb.persist() # Persist the vector store to disk
145
  return vectordb
146
 
147
+
148
  def create_retriever(vectordb):
149
  """
150
  Create a retriever from the vector store.