Spaces:
Runtime error
Runtime error
updated app.py
Browse files
app.py
CHANGED
@@ -60,11 +60,12 @@ def answer(text,context=""):
|
|
60 |
|
61 |
# helper function for RAG
|
62 |
def helper_rag(text):
|
63 |
-
|
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 |
-
|
|
|
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 |
|