Spaces:
Build error
Build error
trying a new summarizer model
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ def start_haystack():
|
|
| 17 |
split_length=200,
|
| 18 |
split_respect_sentence_boundary=True,
|
| 19 |
)
|
| 20 |
-
summarizer = TransformersSummarizer(model_name_or_path="
|
| 21 |
return document_store, summarizer, preprocessor
|
| 22 |
|
| 23 |
|
|
@@ -44,7 +44,6 @@ document_store, summarizer, preprocessor = start_haystack()
|
|
| 44 |
uploaded_files = st.file_uploader("Choose PDF files", accept_multiple_files=True)
|
| 45 |
|
| 46 |
if uploaded_files is not None:
|
| 47 |
-
st.write(len(uploaded_files))
|
| 48 |
if st.button('Summarize Documents'):
|
| 49 |
summarize(uploaded_files)
|
| 50 |
|
|
@@ -52,4 +51,4 @@ if st.button('Calculate num of docs'):
|
|
| 52 |
st.write(document_store.get_document_count())
|
| 53 |
|
| 54 |
if st.button('Clear DocumentStore'):
|
| 55 |
-
document_store.
|
|
|
|
| 17 |
split_length=200,
|
| 18 |
split_respect_sentence_boundary=True,
|
| 19 |
)
|
| 20 |
+
summarizer = TransformersSummarizer(model_name_or_path="facebook/bart-large-cnn")
|
| 21 |
return document_store, summarizer, preprocessor
|
| 22 |
|
| 23 |
|
|
|
|
| 44 |
uploaded_files = st.file_uploader("Choose PDF files", accept_multiple_files=True)
|
| 45 |
|
| 46 |
if uploaded_files is not None:
|
|
|
|
| 47 |
if st.button('Summarize Documents'):
|
| 48 |
summarize(uploaded_files)
|
| 49 |
|
|
|
|
| 51 |
st.write(document_store.get_document_count())
|
| 52 |
|
| 53 |
if st.button('Clear DocumentStore'):
|
| 54 |
+
document_store.delete_documents()
|