Update app.py
Browse files
app.py
CHANGED
@@ -83,16 +83,19 @@ def bansum(text):
|
|
83 |
st.success(text_output)
|
84 |
|
85 |
st.title("Bangla and English Summarizer: Upload Images/Pdf or input texts to summarize!")
|
86 |
-
|
87 |
-
|
|
|
|
|
88 |
""" NLP Based Application with Streamlit """
|
89 |
if "photo" not in st.session_state:
|
90 |
st.session_state["photo"]="not done"
|
91 |
def change_photo_state():
|
92 |
st.session_state["photo"]="done"
|
93 |
message = st.text_input("Type your text here!")
|
94 |
-
|
95 |
-
|
|
|
96 |
if st.checkbox("Summarization"):
|
97 |
if st.session_state["photo"]=="done" or message:
|
98 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
|
|
83 |
st.success(text_output)
|
84 |
|
85 |
st.title("Bangla and English Summarizer: Upload Images/Pdf or input texts to summarize!")
|
86 |
+
@st.cache
|
87 |
+
def load(x):
|
88 |
+
return x
|
89 |
+
|
90 |
""" NLP Based Application with Streamlit """
|
91 |
if "photo" not in st.session_state:
|
92 |
st.session_state["photo"]="not done"
|
93 |
def change_photo_state():
|
94 |
st.session_state["photo"]="done"
|
95 |
message = st.text_input("Type your text here!")
|
96 |
+
c2, c3 = st.columns([2,1])
|
97 |
+
uploaded_photo = load(c2.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state))
|
98 |
+
camera_photo = load(c3.camera_input("Capture a photo to summarize: ", on_change=change_photo_state))
|
99 |
if st.checkbox("Summarization"):
|
100 |
if st.session_state["photo"]=="done" or message:
|
101 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|