Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,6 @@ installed_packages = pkg_resources.working_set
|
|
24 |
package_list_ = ""
|
25 |
for package in installed_packages:
|
26 |
package_list_ = package_list_ + f"{package.key}=={package.version}\n"
|
27 |
-
|
28 |
print(package_list_)
|
29 |
|
30 |
|
@@ -33,6 +32,8 @@ print(package_list_)
|
|
33 |
# vectorestore colection are stored on persistent storage so this needs to be run only once
|
34 |
# hence, comment out line below when creating for first time
|
35 |
vectorstores = process_pdf()
|
|
|
|
|
36 |
|
37 |
# -------------------------------------------------------------
|
38 |
# Functions
|
@@ -102,9 +103,9 @@ async def chat(query,history,sources,reports,subtype,year):
|
|
102 |
|
103 |
##------------------------decide which collection to fetch------------------------------
|
104 |
if len(reports) == 0:
|
105 |
-
vectorstore = get_local_qdrant(sources)
|
106 |
else:
|
107 |
-
vectorstore = get_local_qdrant("allreports")
|
108 |
|
109 |
##------------------------------get context----------------------------------------------------
|
110 |
context_retrieved_lst = []
|
|
|
24 |
package_list_ = ""
|
25 |
for package in installed_packages:
|
26 |
package_list_ = package_list_ + f"{package.key}=={package.version}\n"
|
|
|
27 |
print(package_list_)
|
28 |
|
29 |
|
|
|
32 |
# vectorestore colection are stored on persistent storage so this needs to be run only once
|
33 |
# hence, comment out line below when creating for first time
|
34 |
vectorstores = process_pdf()
|
35 |
+
# once the vectore embeddings are created we will qdrant client to access these
|
36 |
+
client = QdrantClient(path=f"./data/local_qdrant")
|
37 |
|
38 |
# -------------------------------------------------------------
|
39 |
# Functions
|
|
|
103 |
|
104 |
##------------------------decide which collection to fetch------------------------------
|
105 |
if len(reports) == 0:
|
106 |
+
vectorstore = get_local_qdrant(client,sources)
|
107 |
else:
|
108 |
+
vectorstore = get_local_qdrant(client,"allreports")
|
109 |
|
110 |
##------------------------------get context----------------------------------------------------
|
111 |
context_retrieved_lst = []
|