Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
sidebar fixed
Browse files
pages/Multimodal_Conversational_Search.py
CHANGED
|
@@ -515,29 +515,29 @@ with st.sidebar:
|
|
| 515 |
|
| 516 |
|
| 517 |
# st.subheader(":blue[Your multi-modal documents]")
|
| 518 |
-
|
| 519 |
-
|
| 520 |
|
| 521 |
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
|
| 542 |
############## haystach demo temporary addition ############
|
| 543 |
# st.subheader(":blue[Multimodality]")
|
|
|
|
| 515 |
|
| 516 |
|
| 517 |
# st.subheader(":blue[Your multi-modal documents]")
|
| 518 |
+
pdf_doc_ = st.file_uploader(
|
| 519 |
+
"Upload your PDFs here and click on 'Process'", accept_multiple_files=False)
|
| 520 |
|
| 521 |
|
| 522 |
+
pdf_docs = [pdf_doc_]
|
| 523 |
+
if st.button("Process"):
|
| 524 |
+
with st.spinner("Processing"):
|
| 525 |
+
if os.path.isdir(parent_dirname+"/pdfs") == False:
|
| 526 |
+
os.mkdir(parent_dirname+"/pdfs")
|
| 527 |
|
| 528 |
+
for pdf_doc in pdf_docs:
|
| 529 |
+
print(type(pdf_doc))
|
| 530 |
+
pdf_doc_name = (pdf_doc.name).replace(" ","_")
|
| 531 |
+
with open(os.path.join(parent_dirname+"/pdfs",pdf_doc_name),"wb") as f:
|
| 532 |
+
f.write(pdf_doc.getbuffer())
|
| 533 |
|
| 534 |
+
request_ = { "bucket": s3_bucket_,"key": pdf_doc_name}
|
| 535 |
+
# if(st.session_state.input_copali_rerank):
|
| 536 |
+
# copali.process_doc(request_)
|
| 537 |
+
# else:
|
| 538 |
+
rag_DocumentLoader.load_docs(request_)
|
| 539 |
+
print('lambda done')
|
| 540 |
+
st.success('you can start searching on your PDF')
|
| 541 |
|
| 542 |
############## haystach demo temporary addition ############
|
| 543 |
# st.subheader(":blue[Multimodality]")
|