3v324v23 commited on
Commit
7e6b19f
·
1 Parent(s): 315d5e7

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -60,11 +60,12 @@ def answer(text,context=""):
60
 
61
  # helper function for RAG
62
  def helper_rag(text):
63
- #docs_out = vectordb.similarity_search_with_relevance_scores(text,k=5)
64
- docs_out = vectordb.max_marginal_relevance_search(text,k=5,fetch_k = 20, lambda_mult = 0.5)
65
  context = ""
66
  for doc in docs_out:
67
- context += doc.page_content + "\n"
 
68
 
69
  return context
70
 
 
60
 
61
  # helper function for RAG
62
  def helper_rag(text):
63
+ docs_out = vectordb.similarity_search_with_relevance_scores(text,k=5)
64
+ #docs_out = vectordb.max_marginal_relevance_search(text,k=5,fetch_k = 20, lambda_mult = 0.5)
65
  context = ""
66
  for doc in docs_out:
67
+ if doc[1] > 0.7:
68
+ context += doc[0].page_content + "\n"
69
 
70
  return context
71