prasadnu commited on
Commit
768b368
·
1 Parent(s): 46dbc49

git ignore

Browse files
RAG/rag_DocumentLoader.py CHANGED
@@ -30,7 +30,7 @@ region = 'us-east-1'
30
  service = 'es'
31
 
32
  credentials = boto3.Session().get_credentials()
33
- auth = HTTPBasicAuth('prasadnu',st.secrets['rag_shopping_assistant_os_api_access'])
34
  #"https://search-opensearchservi-shjckef2t7wo-iyv6rajdgxg6jas25aupuxev6i.us-west-2.es.amazonaws.com/"
35
 
36
  ospy_client = OpenSearch(
 
30
  service = 'es'
31
 
32
  credentials = boto3.Session().get_credentials()
33
+ auth = HTTPBasicAuth('master',st.secrets['ml_search_demo_api_access'])
34
  #"https://search-opensearchservi-shjckef2t7wo-iyv6rajdgxg6jas25aupuxev6i.us-west-2.es.amazonaws.com/"
35
 
36
  ospy_client = OpenSearch(
pages/Multimodal_Conversational_Search.py CHANGED
@@ -117,7 +117,7 @@ st.markdown("""
117
 
118
 
119
  credentials = boto3.Session().get_credentials()
120
- awsauth = awsauth = HTTPBasicAuth('master',st.secrets['ml_search_demo_api_access'])
121
  service = 'es'
122
 
123
 
@@ -463,30 +463,30 @@ with st.sidebar:
463
  st.markdown("<span style = 'color:#FF9900;'>Covid19 impacts</span> - How many aged above 85 years died due to covid ?",unsafe_allow_html=True)
464
 
465
 
466
- # st.subheader(":blue[Your multi-modal documents]")
467
- # pdf_doc_ = st.file_uploader(
468
- # "Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
469
 
470
 
471
- # pdf_docs = [pdf_doc_]
472
- # if st.button("Process"):
473
- # with st.spinner("Processing"):
474
- # if os.path.isdir(parent_dirname+"/pdfs") == False:
475
- # os.mkdir(parent_dirname+"/pdfs")
476
 
477
- # for pdf_doc in pdf_docs:
478
- # print(type(pdf_doc))
479
- # pdf_doc_name = (pdf_doc.name).replace(" ","_")
480
- # with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
481
- # f.write(pdf_doc.getbuffer())
482
 
483
- # request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
484
- # # if(st.session_state.input_copali_rerank):
485
- # # copali.process_doc(request_)
486
- # # else:
487
- # rag_DocumentLoader.load_docs(request_)
488
- # print('lambda done')
489
- # st.success('you can start searching on your PDF')
490
 
491
  ############## haystach demo temporary addition ############
492
  # st.subheader(":blue[Multimodality]")
 
117
 
118
 
119
  credentials = boto3.Session().get_credentials()
120
+ awsauth = HTTPBasicAuth('master',st.secrets['ml_search_demo_api_access'])
121
  service = 'es'
122
 
123
 
 
463
  st.markdown("<span style = 'color:#FF9900;'>Covid19 impacts</span> - How many aged above 85 years died due to covid ?",unsafe_allow_html=True)
464
 
465
 
466
+ st.subheader(":blue[Your multi-modal documents]")
467
+ pdf_doc_ = st.file_uploader(
468
+ "Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
469
 
470
 
471
+ pdf_docs = [pdf_doc_]
472
+ if st.button("Process"):
473
+ with st.spinner("Processing"):
474
+ if os.path.isdir(parent_dirname+"/pdfs") == False:
475
+ os.mkdir(parent_dirname+"/pdfs")
476
 
477
+ for pdf_doc in pdf_docs:
478
+ print(type(pdf_doc))
479
+ pdf_doc_name = (pdf_doc.name).replace(" ","_")
480
+ with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
481
+ f.write(pdf_doc.getbuffer())
482
 
483
+ request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
484
+ # if(st.session_state.input_copali_rerank):
485
+ # copali.process_doc(request_)
486
+ # else:
487
+ rag_DocumentLoader.load_docs(request_)
488
+ print('lambda done')
489
+ st.success('you can start searching on your PDF')
490
 
491
  ############## haystach demo temporary addition ############
492
  # st.subheader(":blue[Multimodality]")