Shreyas094 commited on
Commit
1525d54
·
verified ·
1 Parent(s): b0cb50b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -323,7 +323,7 @@ def respond(message, history, model, temperature, num_calls, use_web_search, sel
323
  embed = get_embeddings()
324
  if os.path.exists("faiss_database"):
325
  database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
326
- retriever = database.as_retriever(search_kwargs={"k": 10})
327
 
328
  # Filter relevant documents based on user selection
329
  all_relevant_docs = retriever.get_relevant_documents(message)
@@ -460,7 +460,7 @@ def get_response_from_pdf(query, model, selected_docs, num_calls=3, temperature=
460
  yield "No documents available. Please upload PDF documents to answer questions."
461
  return
462
 
463
- retriever = database.as_retriever(search_kwargs={"k": 10})
464
  logging.info(f"Retrieving relevant documents for query: {query}")
465
  relevant_docs = retriever.get_relevant_documents(query)
466
  logging.info(f"Number of relevant documents retrieved: {len(relevant_docs)}")
 
323
  embed = get_embeddings()
324
  if os.path.exists("faiss_database"):
325
  database = FAISS.load_local("faiss_database", embed, allow_dangerous_deserialization=True)
326
+ retriever = database.as_retriever(search_kwargs={"k": 20})
327
 
328
  # Filter relevant documents based on user selection
329
  all_relevant_docs = retriever.get_relevant_documents(message)
 
460
  yield "No documents available. Please upload PDF documents to answer questions."
461
  return
462
 
463
+ retriever = database.as_retriever(search_kwargs={"k": 20})
464
  logging.info(f"Retrieving relevant documents for query: {query}")
465
  relevant_docs = retriever.get_relevant_documents(query)
466
  logging.info(f"Number of relevant documents retrieved: {len(relevant_docs)}")