Chandranshu Jain commited on
Commit
352a5fd
1 Parent(s): 528fe2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -39,7 +39,7 @@ def get_pdf(uploaded_file):
39
  file.write(uploaded_file.getvalue())
40
  file_name = uploaded_file.name
41
  loader = PyPDFLoader(temp_file)
42
- docs = loader.load_and_split()
43
  return docs
44
 
45
  def text_splitter(text):
@@ -69,7 +69,7 @@ def get_conversational_chain():
69
 
70
  def embedding(chunk,query):
71
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
72
- db = Chroma.from_documents(chunk,embeddings, persist_directory="./chroma_db")
73
  docs = db.similarity_search(query)
74
  chain = get_conversational_chain()
75
  response = chain({"input_documents": docs, "question": query}, return_only_outputs=True)
 
39
  file.write(uploaded_file.getvalue())
40
  file_name = uploaded_file.name
41
  loader = PyPDFLoader(temp_file)
42
+ docs = loader.load()
43
  return docs
44
 
45
  def text_splitter(text):
 
69
 
70
  def embedding(chunk,query):
71
  embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
72
+ db = Chroma.from_documents(chunk,embeddings)
73
  docs = db.similarity_search(query)
74
  chain = get_conversational_chain()
75
  response = chain({"input_documents": docs, "question": query}, return_only_outputs=True)