Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,8 @@ from langchain_huggingface import HuggingFaceEndpoint
|
|
19 |
from dotenv import load_dotenv
|
20 |
load_dotenv()
|
21 |
HF_token = os.environ["HF_TOKEN"]
|
22 |
-
|
|
|
23 |
|
24 |
# -------------------------------------------------------------
|
25 |
# Functions
|
@@ -84,7 +85,13 @@ async def chat(query,history,sources,reports):
|
|
84 |
print(f"reports:{reports}")
|
85 |
docs_html = ""
|
86 |
output_query = ""
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
yield history,docs_html
|
90 |
#process_pdf()
|
|
|
19 |
from dotenv import load_dotenv
|
20 |
load_dotenv()
|
21 |
HF_token = os.environ["HF_TOKEN"]
|
22 |
+
# process all files and get the vectorstores collections
|
23 |
+
vectorstores = process_pdf()
|
24 |
|
25 |
# -------------------------------------------------------------
|
26 |
# Functions
|
|
|
85 |
print(f"reports:{reports}")
|
86 |
docs_html = ""
|
87 |
output_query = ""
|
88 |
+
|
89 |
+
|
90 |
+
if reports is not None:
|
91 |
+
vectorstore = vectorstores[source]
|
92 |
+
else:
|
93 |
+
vectorstore = vectorstores["allreports"]
|
94 |
+
|
95 |
|
96 |
yield history,docs_html
|
97 |
#process_pdf()
|