waqasali1707 commited on
Commit
33f1c38
·
verified ·
1 Parent(s): 7a3fac5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -56,8 +56,16 @@ def load_pdfs():
56
 
57
  # Create embeddings and vector store for the current tenant
58
  embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
 
 
 
 
59
  if st.session_state.tenant not in st.session_state.vectordb:
60
- st.session_state.vectordb[st.session_state.tenant] = Chroma.from_documents(documents=splits, embedding=embeddings)
 
 
 
 
61
  else:
62
  # Update the existing vector store for the tenant
63
  st.session_state.vectordb[st.session_state.tenant].add_documents(splits)
 
56
 
57
  # Create embeddings and vector store for the current tenant
58
  embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
59
+
60
+ # Directory to store the vector database
61
+ db_directory = "path/to/store/chroma_db" # Update with your desired path
62
+
63
  if st.session_state.tenant not in st.session_state.vectordb:
64
+ st.session_state.vectordb[st.session_state.tenant] = Chroma.from_documents(
65
+ documents=splits,
66
+ embedding=embeddings,
67
+ persist_directory=db_directory
68
+ )
69
  else:
70
  # Update the existing vector store for the tenant
71
  st.session_state.vectordb[st.session_state.tenant].add_documents(splits)