Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from streamlit.components.v1 import html
|
|
3 |
import os
|
4 |
import PyPDF2
|
5 |
import requests
|
|
|
6 |
|
7 |
def get_pdf_text(pdf_path):
|
8 |
# creating a pdf file object
|
@@ -23,6 +24,8 @@ def get_pdf_text(pdf_path):
|
|
23 |
|
24 |
return pdf_text
|
25 |
|
|
|
|
|
26 |
headers = {"Authorization": st.secrets["HF_AUTH"]}
|
27 |
|
28 |
def create_tags(payload):
|
@@ -95,6 +98,9 @@ with tab_your_paper:
|
|
95 |
else:
|
96 |
st.markdown("#### Summary of your paper:")
|
97 |
st.write(summary)
|
|
|
|
|
|
|
98 |
|
99 |
if tags_available == True:
|
100 |
with col2:
|
|
|
3 |
import os
|
4 |
import PyPDF2
|
5 |
import requests
|
6 |
+
from transformers import pipeline
|
7 |
|
8 |
def get_pdf_text(pdf_path):
|
9 |
# creating a pdf file object
|
|
|
24 |
|
25 |
return pdf_text
|
26 |
|
27 |
+
sum_model = pipeline("text2text-generation", model="yasminesarraj/flan-t5-small-samsum")
|
28 |
+
|
29 |
headers = {"Authorization": st.secrets["HF_AUTH"]}
|
30 |
|
31 |
def create_tags(payload):
|
|
|
98 |
else:
|
99 |
st.markdown("#### Summary of your paper:")
|
100 |
st.write(summary)
|
101 |
+
else:
|
102 |
+
with col1:
|
103 |
+
st.write(sum_model(all_text_together))
|
104 |
|
105 |
if tags_available == True:
|
106 |
with col2:
|