Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -104,25 +104,27 @@ async def chat(query,history,sources,reports,subtype,year):
|
|
| 104 |
|
| 105 |
##------------------------decide which collection to fetch------------------------------
|
| 106 |
if len(reports) == 0:
|
| 107 |
-
|
|
|
|
| 108 |
else:
|
| 109 |
-
|
|
|
|
| 110 |
|
| 111 |
##------------------------------get context----------------------------------------------------
|
| 112 |
-
context_retrieved_lst = []
|
| 113 |
-
question_lst= [query]
|
| 114 |
-
for question in question_lst:
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
print(context_retrieved_lst)
|
| 126 |
|
| 127 |
|
| 128 |
|
|
|
|
| 104 |
|
| 105 |
##------------------------decide which collection to fetch------------------------------
|
| 106 |
if len(reports) == 0:
|
| 107 |
+
print("done")
|
| 108 |
+
#vectorstore = get_local_qdrant(client,sources)
|
| 109 |
else:
|
| 110 |
+
print("done")
|
| 111 |
+
#vectorstore = get_local_qdrant(client,"allreports")
|
| 112 |
|
| 113 |
##------------------------------get context----------------------------------------------------
|
| 114 |
+
#context_retrieved_lst = []
|
| 115 |
+
#question_lst= [query]
|
| 116 |
+
#for question in question_lst:
|
| 117 |
+
# retriever = vectorstore.as_retriever(
|
| 118 |
+
# search_type="similarity_score_threshold", search_kwargs={"score_threshold": 0.6, "k": 3})
|
| 119 |
+
#
|
| 120 |
+
# context_retrieved = retriever.invoke(question)
|
| 121 |
+
#
|
| 122 |
+
# def format_docs(docs):
|
| 123 |
+
# return "\n\n".join(doc.page_content for doc in docs)
|
| 124 |
+
|
| 125 |
+
# context_retrieved_formatted = format_docs(context_retrieved)
|
| 126 |
+
# context_retrieved_lst.append(context_retrieved_formatted)
|
| 127 |
+
# print(context_retrieved_lst)
|
| 128 |
|
| 129 |
|
| 130 |
|