Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
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 =
|
| 98 |
else:
|
| 99 |
-
vectorstore =
|
| 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 = []
|