ppsingh commited on
Commit
7471ef6
·
verified ·
1 Parent(s): 59481de

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
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
- # 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['iati_id']+":"+i.metadata['title_main'])
178
- # st.caption(f"Status:{i.metadata['status']}, Country:{i.metadata['country_name']}")
179
- # st.write(i.page_content)
180
- # st.divider()
 
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()