ppsingh commited on
Commit
2b7be76
1 Parent(s): 5d0e7b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -16
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
- vectorstore = get_local_qdrant(client,sources)
 
108
  else:
109
- vectorstore = get_local_qdrant(client,"allreports")
 
110
 
111
  ##------------------------------get context----------------------------------------------------
112
- context_retrieved_lst = []
113
- question_lst= [query]
114
- for question in question_lst:
115
- retriever = vectorstore.as_retriever(
116
- search_type="similarity_score_threshold", search_kwargs={"score_threshold": 0.6, "k": 3})
117
-
118
- context_retrieved = retriever.invoke(question)
119
-
120
- def format_docs(docs):
121
- return "\n\n".join(doc.page_content for doc in docs)
122
-
123
- context_retrieved_formatted = format_docs(context_retrieved)
124
- context_retrieved_lst.append(context_retrieved_formatted)
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