prasadnu commited on
Commit
29b27a9
·
1 Parent(s): fb69d13

app fixes UI

Browse files
pages/Multimodal_Conversational_Search.py CHANGED
@@ -319,11 +319,11 @@ with st.sidebar:
319
  st.subheader(":blue[Sample Data]")
320
  coln_1,coln_2 = st.columns([70,30])
321
  with coln_1:
322
- index_select = st.radio("Choose one index",["UK Housing","Global Warming stats","Covid19 impacts on Ireland"],key="input_rad_index")
323
  with coln_2:
324
  st.markdown("<p style='font-size:15px'>Preview file</p>",unsafe_allow_html=True)
325
- st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/HPI-Jan-2024-Hometrack.pdf)")
326
  st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/global_warming.pdf)")
 
327
  st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/covid19_ie.pdf)")
328
  st.markdown("""
329
  <style>
@@ -336,36 +336,36 @@ with st.sidebar:
336
  </style>
337
  """,unsafe_allow_html=True)
338
  with st.expander("Sample questions:"):
339
- st.markdown("<span style = 'color:#FF9900;'>UK Housing</span> - which city has the highest average housing price in UK ?",unsafe_allow_html=True)
340
  st.markdown("<span style = 'color:#FF9900;'>Global Warming stats</span> - What is the projected energy percentage from renewable sources in future?",unsafe_allow_html=True)
 
341
  st.markdown("<span style = 'color:#FF9900;'>Covid19 impacts</span> - How many aged above 85 years died due to covid ?",unsafe_allow_html=True)
342
 
343
 
344
 
345
  # st.subheader(":blue[Your multi-modal documents]")
346
- pdf_doc_ = st.file_uploader(
347
- "Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
348
 
349
 
350
- pdf_docs = [pdf_doc_]
351
- if st.button("Process"):
352
- with st.spinner("Processing"):
353
- if os.path.isdir(parent_dirname+"/pdfs") == False:
354
- os.mkdir(parent_dirname+"/pdfs")
355
 
356
- for pdf_doc in pdf_docs:
357
- print(type(pdf_doc))
358
- pdf_doc_name = (pdf_doc.name).replace(" ","_")
359
- with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
360
- f.write(pdf_doc.getbuffer())
361
 
362
- request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
363
- # if(st.session_state.input_copali_rerank):
364
- # copali.process_doc(request_)
365
- # else:
366
- rag_DocumentLoader.load_docs(request_)
367
- print('lambda done')
368
- st.success('you can start searching on your PDF')
369
 
370
  ############## haystach demo temporary addition ############
371
  #if(pdf_doc_ is None or pdf_doc_ == ""):
 
319
  st.subheader(":blue[Sample Data]")
320
  coln_1,coln_2 = st.columns([70,30])
321
  with coln_1:
322
+ index_select = st.radio("Choose one index",["Global Warming stats","UK Housing","Covid19 impacts on Ireland"],key="input_rad_index")
323
  with coln_2:
324
  st.markdown("<p style='font-size:15px'>Preview file</p>",unsafe_allow_html=True)
 
325
  st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/global_warming.pdf)")
326
+ st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/HPI-Jan-2024-Hometrack.pdf)")
327
  st.write("[:eyes:](https://github.com/aws-samples/AI-search-with-amazon-opensearch-service/blob/b559f82c07dfcca973f457c0a15d6444752553ab/rag/sample_pdfs/covid19_ie.pdf)")
328
  st.markdown("""
329
  <style>
 
336
  </style>
337
  """,unsafe_allow_html=True)
338
  with st.expander("Sample questions:"):
 
339
  st.markdown("<span style = 'color:#FF9900;'>Global Warming stats</span> - What is the projected energy percentage from renewable sources in future?",unsafe_allow_html=True)
340
+ st.markdown("<span style = 'color:#FF9900;'>UK Housing</span> - which city has the highest average housing price in UK ?",unsafe_allow_html=True)
341
  st.markdown("<span style = 'color:#FF9900;'>Covid19 impacts</span> - How many aged above 85 years died due to covid ?",unsafe_allow_html=True)
342
 
343
 
344
 
345
  # st.subheader(":blue[Your multi-modal documents]")
346
+ # pdf_doc_ = st.file_uploader(
347
+ # "Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
348
 
349
 
350
+ # pdf_docs = [pdf_doc_]
351
+ # if st.button("Process"):
352
+ # with st.spinner("Processing"):
353
+ # if os.path.isdir(parent_dirname+"/pdfs") == False:
354
+ # os.mkdir(parent_dirname+"/pdfs")
355
 
356
+ # for pdf_doc in pdf_docs:
357
+ # print(type(pdf_doc))
358
+ # pdf_doc_name = (pdf_doc.name).replace(" ","_")
359
+ # with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
360
+ # f.write(pdf_doc.getbuffer())
361
 
362
+ # request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
363
+ # # if(st.session_state.input_copali_rerank):
364
+ # # copali.process_doc(request_)
365
+ # # else:
366
+ # rag_DocumentLoader.load_docs(request_)
367
+ # print('lambda done')
368
+ # st.success('you can start searching on your PDF')
369
 
370
  ############## haystach demo temporary addition ############
371
  #if(pdf_doc_ is None or pdf_doc_ == ""):