Spaces:
Build error
Build error
delete all documents button
Browse files
app.py
CHANGED
@@ -27,21 +27,22 @@ def pdf_to_document_store(pdf_files):
|
|
27 |
st.write(len(documents))
|
28 |
preprocessed_docs = preprocessor.process(documents)
|
29 |
document_store.write_documents(preprocessed_docs)
|
30 |
-
return None
|
31 |
|
32 |
def summarize(files):
|
33 |
pdf_to_document_store(files)
|
34 |
summary = summarizer.predict(documents=document_store.get_all_documents(), generate_single_summary=True)
|
35 |
st.write(summary)
|
36 |
-
|
|
|
37 |
uploaded_files = st.file_uploader("Choose PDF files", accept_multiple_files=True)
|
38 |
|
39 |
if uploaded_files is not None:
|
40 |
st.write(len(uploaded_files))
|
41 |
if st.button('Summarize Documents'):
|
42 |
-
document_store.delete_documents()
|
43 |
summarize(uploaded_files)
|
44 |
|
45 |
if st.button('Calculate num of docs'):
|
46 |
st.write(document_store.get_document_count())
|
47 |
|
|
|
|
|
|
27 |
st.write(len(documents))
|
28 |
preprocessed_docs = preprocessor.process(documents)
|
29 |
document_store.write_documents(preprocessed_docs)
|
|
|
30 |
|
31 |
def summarize(files):
|
32 |
pdf_to_document_store(files)
|
33 |
summary = summarizer.predict(documents=document_store.get_all_documents(), generate_single_summary=True)
|
34 |
st.write(summary)
|
35 |
+
|
36 |
+
|
37 |
uploaded_files = st.file_uploader("Choose PDF files", accept_multiple_files=True)
|
38 |
|
39 |
if uploaded_files is not None:
|
40 |
st.write(len(uploaded_files))
|
41 |
if st.button('Summarize Documents'):
|
|
|
42 |
summarize(uploaded_files)
|
43 |
|
44 |
if st.button('Calculate num of docs'):
|
45 |
st.write(document_store.get_document_count())
|
46 |
|
47 |
+
if st.button('Clear DocumentStore'):
|
48 |
+
document_store.delete_all_documents()
|