Spaces:
Running
on
T4
Running
on
T4
RAG upfated
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
@@ -468,29 +468,29 @@ with st.sidebar:
|
|
468 |
|
469 |
|
470 |
#st.subheader(":blue[Your multi-modal documents]")
|
471 |
-
|
472 |
-
|
473 |
|
474 |
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
|
495 |
############## haystach demo temporary addition ############
|
496 |
# st.subheader(":blue[Multimodality]")
|
|
|
468 |
|
469 |
|
470 |
#st.subheader(":blue[Your multi-modal documents]")
|
471 |
+
pdf_doc_ = st.file_uploader(
|
472 |
+
"Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
|
473 |
|
474 |
|
475 |
+
pdf_docs = [pdf_doc_]
|
476 |
+
if st.button("Process"):
|
477 |
+
with st.spinner("Processing"):
|
478 |
+
if os.path.isdir(parent_dirname+"/pdfs") == False:
|
479 |
+
os.mkdir(parent_dirname+"/pdfs")
|
480 |
|
481 |
+
for pdf_doc in pdf_docs:
|
482 |
+
print(type(pdf_doc))
|
483 |
+
pdf_doc_name = (pdf_doc.name).replace(" ","_")
|
484 |
+
with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
|
485 |
+
f.write(pdf_doc.getbuffer())
|
486 |
|
487 |
+
request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
|
488 |
+
# if(st.session_state.input_copali_rerank):
|
489 |
+
# copali.process_doc(request_)
|
490 |
+
# else:
|
491 |
+
rag_DocumentLoader.load_docs(request_)
|
492 |
+
print('lambda done')
|
493 |
+
st.success('you can start searching on your PDF')
|
494 |
|
495 |
############## haystach demo temporary addition ############
|
496 |
# st.subheader(":blue[Multimodality]")
|