Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -50,7 +50,7 @@ if uploaded_file is not None:
|
|
| 50 |
for key, values in essay.items():
|
| 51 |
st.write(f"{key}: {', '.join(values)}")
|
| 52 |
|
| 53 |
-
with st.status("
|
| 54 |
|
| 55 |
Barttokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')
|
| 56 |
summ_model_path = 'com3dian/Bart-large-paper2slides-summarizer'
|
|
@@ -65,9 +65,10 @@ if uploaded_file is not None:
|
|
| 65 |
del Barttokenizer
|
| 66 |
length = document.merge(25, 30, BartSE, device)
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
| 50 |
for key, values in essay.items():
|
| 51 |
st.write(f"{key}: {', '.join(values)}")
|
| 52 |
|
| 53 |
+
with st.status("Understanding paper..."):
|
| 54 |
|
| 55 |
Barttokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')
|
| 56 |
summ_model_path = 'com3dian/Bart-large-paper2slides-summarizer'
|
|
|
|
| 65 |
del Barttokenizer
|
| 66 |
length = document.merge(25, 30, BartSE, device)
|
| 67 |
|
| 68 |
+
with st.status("Generating slides...":)
|
| 69 |
+
summarizor = pipeline("summarization", model=summ_model_path, device = device)
|
| 70 |
+
summ_text = summarizor(document.segmentation['text'], max_length=100, min_length=10, do_sample=False)
|
| 71 |
+
summ_text = [text['summary_text'] for text in summ_text]
|
| 72 |
+
|
| 73 |
+
for summ in summ_text:
|
| 74 |
+
st.write(summ)
|