Commit
·
cd7382a
1
Parent(s):
d9ae846
Update app.py
Browse files
app.py
CHANGED
@@ -256,21 +256,13 @@ with st.form("my_form"):
|
|
256 |
|
257 |
list_docs = []
|
258 |
list_save_path = []
|
259 |
-
|
260 |
uploaded_files = st.file_uploader("Choose file(s)", accept_multiple_files=True)
|
261 |
-
for uploaded_file in uploaded_files:
|
262 |
-
save_path = Path(os.getcwd(), uploaded_file.name)
|
263 |
-
with open(save_path, mode='wb') as w:
|
264 |
-
w.write(uploaded_file.getvalue())
|
265 |
-
docs = fitz.open(save_path)
|
266 |
-
list_docs.append(docs)
|
267 |
-
list_save_path.append(save_path)
|
268 |
-
|
269 |
print('uploaded_files ', uploaded_files)
|
270 |
single_example_passage = st.text_area('Enter Query Here',"What is Governing Law ")
|
271 |
submitted = st.form_submit_button("Index and Calculate")
|
|
|
272 |
if submitted and (uploaded_files is not None):
|
273 |
-
|
274 |
print('list_docs ' ,list_docs)
|
275 |
print('list_save_path ' , list_save_path)
|
276 |
bm25_retriever = BM25Retriever.from_documents(passage_documents)
|
|
|
256 |
|
257 |
list_docs = []
|
258 |
list_save_path = []
|
|
|
259 |
uploaded_files = st.file_uploader("Choose file(s)", accept_multiple_files=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
print('uploaded_files ', uploaded_files)
|
261 |
single_example_passage = st.text_area('Enter Query Here',"What is Governing Law ")
|
262 |
submitted = st.form_submit_button("Index and Calculate")
|
263 |
+
|
264 |
if submitted and (uploaded_files is not None):
|
265 |
+
list_docs, list_save_path = util_upload_file_and_return_list_docs(uploaded_files)
|
266 |
print('list_docs ' ,list_docs)
|
267 |
print('list_save_path ' , list_save_path)
|
268 |
bm25_retriever = BM25Retriever.from_documents(passage_documents)
|