Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -160,21 +160,21 @@ def get_context(vectorstore,query):
|
|
160 |
return context_retrieved
|
161 |
|
162 |
# first we create the chunks for iati documents
|
163 |
-
chunks = get_chunks()
|
164 |
-
print("chunking done")
|
165 |
|
166 |
# once the chunks are done, we perform hybrid emebddings
|
167 |
-
embed_chunks(chunks)
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
|
|
160 |
return context_retrieved
|
161 |
|
162 |
# first we create the chunks for iati documents
|
163 |
+
#chunks = get_chunks()
|
164 |
+
#print("chunking done")
|
165 |
|
166 |
# once the chunks are done, we perform hybrid emebddings
|
167 |
+
#embed_chunks(chunks)
|
168 |
+
|
169 |
+
vectorstores = get_local_qdrant()
|
170 |
+
vectorstore = vectorstores['all']
|
171 |
+
button=st.button("search")
|
172 |
+
results= get_context(vectorstore, f"find the relvant paragraphs for: {var}")
|
173 |
+
if button:
|
174 |
+
st.write(f"Found {len(results)} results for query:{var}")
|
175 |
+
|
176 |
+
for i in results:
|
177 |
+
st.subheader(i.metadata['id']+":"+i.metadata['title_main'])
|
178 |
+
st.caption(f"Status:{i.metadata['status']}, Country:{i.metadata['country_name']}, Source:{i.metadata['source']}")
|
179 |
+
st.write(i.page_content)
|
180 |
+
st.divider()
|