Soumen commited on
Commit
bf72d34
·
1 Parent(s): 2d1cbd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -131,7 +131,7 @@ def main():
131
  img = Image.open(uploaded_photo)
132
  img = img.save("img.png")
133
  img = cv2.imread("img.png")
134
- st.text("Select the summarization type:")
135
  c4, c5 = st.columns([1,7])
136
  if c4.button("BENGALI"):
137
  text = pytesseract.image_to_string(img, lang="ben")
@@ -149,7 +149,7 @@ def main():
149
  img = img.save("img.png")
150
  img = cv2.imread("img.png")
151
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
152
- st.text("Select the summarization type:")
153
  #st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
154
  c6, c7 = st.columns([1,7])
155
  if c6.button("Bangla"):
@@ -199,11 +199,12 @@ def main():
199
  st.session_state.history.append({"message": user_message, "is_user": True})
200
  st.session_state.history.append({"message": message_bot, "is_user": False})
201
  from copyreg import clear_extension_cache
202
- for chat in st.session_state.history:
203
- st_message(**chat)
 
204
  st.text_input("Talk to the bot", key="input_text", on_change=generate_answer)
205
  if st.button("Refresh/New Chat"):
206
- st.session_state.history = None
207
 
208
  if __name__ == "__main__":
209
  main()
 
131
  img = Image.open(uploaded_photo)
132
  img = img.save("img.png")
133
  img = cv2.imread("img.png")
134
+ st.subheader("Select the summarization type:")
135
  c4, c5 = st.columns([1,7])
136
  if c4.button("BENGALI"):
137
  text = pytesseract.image_to_string(img, lang="ben")
 
149
  img = img.save("img.png")
150
  img = cv2.imread("img.png")
151
  #text = pytesseract.image_to_string(img) if st.checkbox("Bangla") else pytesseract.image_to_string(img, lang="ben")
152
+ st.subheader("Select the summarization type:")
153
  #st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
154
  c6, c7 = st.columns([1,7])
155
  if c6.button("Bangla"):
 
199
  st.session_state.history.append({"message": user_message, "is_user": True})
200
  st.session_state.history.append({"message": message_bot, "is_user": False})
201
  from copyreg import clear_extension_cache
202
+ if st.session_state.history!=[]:
203
+ for chat in st.session_state.history:
204
+ st_message(**chat)
205
  st.text_input("Talk to the bot", key="input_text", on_change=generate_answer)
206
  if st.button("Refresh/New Chat"):
207
+ st.session_state.history = []
208
 
209
  if __name__ == "__main__":
210
  main()