ppsingh commited on
Commit
bc71919
1 Parent(s): 5930e3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -8,7 +8,7 @@ import json
8
  from auditqa.sample_questions import QUESTIONS
9
  from auditqa.engine.prompts import audience_prompts
10
  from auditqa.reports import files, report_list
11
- from auditqa.doc_process import process_pdf
12
  from langchain_core.messages import (
13
  HumanMessage,
14
  SystemMessage,
@@ -24,7 +24,6 @@ HF_token = os.environ["HF_TOKEN"]
24
  # vectorestore colection are stored on persistent storage so this needs to be run only once
25
  # hence, comment out line below when creating for first time
26
  # vectorstores = process_pdf()
27
- #------now we will only use the existing embedding----------
28
 
29
  # -------------------------------------------------------------
30
  # Functions
@@ -94,9 +93,9 @@ async def chat(query,history,sources,reports,subtype,year):
94
 
95
  ##------------------------decide which collection to fetch------------------------------
96
  if len(reports) == 0:
97
- vectorstore = vectorstores[sources]
98
  else:
99
- vectorstore = vectorstores["allreports"]
100
 
101
  ##------------------------------get context----------------------------------------------------
102
  context_retrieved_lst = []
 
8
  from auditqa.sample_questions import QUESTIONS
9
  from auditqa.engine.prompts import audience_prompts
10
  from auditqa.reports import files, report_list
11
+ from auditqa.doc_process import process_pdf, get_local_qdrant
12
  from langchain_core.messages import (
13
  HumanMessage,
14
  SystemMessage,
 
24
  # vectorestore colection are stored on persistent storage so this needs to be run only once
25
  # hence, comment out line below when creating for first time
26
  # vectorstores = process_pdf()
 
27
 
28
  # -------------------------------------------------------------
29
  # Functions
 
93
 
94
  ##------------------------decide which collection to fetch------------------------------
95
  if len(reports) == 0:
96
+ vectorstore = get_local_qdrant(source)
97
  else:
98
+ vectorstore = get_local_qdrant("allreports")
99
 
100
  ##------------------------------get context----------------------------------------------------
101
  context_retrieved_lst = []