rizzdeep commited on
Commit
c46ef81
·
verified ·
1 Parent(s): 46f3be6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -56,7 +56,10 @@ qa_chain = init_rag_chain()
56
  # ------------- PDF Ingestion -------------
57
  def ingest_pdf(file_bytes: bytes, file_name: str):
58
  embedding = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
59
- vectordb = Chroma(persist_directory="./rag_db", embedding_function=embedding)
 
 
 
60
  with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as tmp:
61
  tmp.write(file_bytes)
62
  tmp_path = tmp.name
 
56
  # ------------- PDF Ingestion -------------
57
  def ingest_pdf(file_bytes: bytes, file_name: str):
58
  embedding = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
59
+ vectordb = Chroma(
60
+ persist_directory=f"./rag_db/{st.session_state.session_id}", # ✅ Fix here
61
+ embedding_function=embedding
62
+ )
63
  with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as tmp:
64
  tmp.write(file_bytes)
65
  tmp_path = tmp.name