Soumen commited on
Commit
47d9c5a
1 Parent(s): 0e1cb76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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
- #st.subheader("Input texts to summarize: ")
87
- #@st.cache_resource(experimental_allow_widgets=True)
 
 
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
- uploaded_photo = st.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
95
- camera_photo = st.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
 
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':