Spaces:
Sleeping
Sleeping
DrishtiSharma
commited on
Update app.py
Browse files
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.
|