Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,8 @@ from llama_index import download_loader
|
|
6 |
st.title("PDF Summarizer")
|
7 |
uploaded_file = st.file_uploader("Upload a PDF file")
|
8 |
if uploaded_file is not None:
|
9 |
-
loader = PDFReader()
|
10 |
-
documents = loader.load_data(file=Path(uploaded_file.name))
|
11 |
-
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
12 |
-
summary = summarizer(str(documents[0]), max_length=130, min_length=30, do_sample=False)
|
13 |
-
st.write(summary[0]["summary_text"])
|
|
|
6 |
st.title("PDF Summarizer")
|
7 |
uploaded_file = st.file_uploader("Upload a PDF file")
|
8 |
if uploaded_file is not None:
|
9 |
+
loader = PDFReader()
|
10 |
+
documents = loader.load_data(file=Path(uploaded_file.name))
|
11 |
+
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
12 |
+
summary = summarizer(str(documents[0]), max_length=130, min_length=30, do_sample=False)
|
13 |
+
st.write(summary[0]["summary_text"])
|