captain-awesome commited on
Commit
999772f
·
1 Parent(s): 592141a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -160,16 +160,20 @@ def create_vector_database(loaded_documents):
160
 
161
  # Initialize HuggingFace embeddings
162
  embeddings = HuggingFaceEmbeddings(
163
- model_name="sentence-transformers/all-MiniLM-L6-v2"
 
164
  )
165
 
166
  # Create and persist a Chroma vector database from the chunked documents
167
  db = Chroma.from_documents(
168
  documents=chunked_documents,
169
  embedding=embeddings,
 
170
  # persist_directory=DB_DIR,
171
  )
172
- db.persist()
 
 
173
  return db
174
 
175
  def set_custom_prompt_condense():
 
160
 
161
  # Initialize HuggingFace embeddings
162
  embeddings = HuggingFaceEmbeddings(
163
+ # model_name="sentence-transformers/all-MiniLM-L6-v2"
164
+ model_name = "BAAI/bge-large-en"
165
  )
166
 
167
  # Create and persist a Chroma vector database from the chunked documents
168
  db = Chroma.from_documents(
169
  documents=chunked_documents,
170
  embedding=embeddings,
171
+ persist_directory=persist_directory
172
  # persist_directory=DB_DIR,
173
  )
174
+ # db.persist()
175
+ db = Chroma(persist_directory=persist_directory,
176
+ embedding_function=embedding)
177
  return db
178
 
179
  def set_custom_prompt_condense():