Soumen commited on
Commit
f5ad0e1
·
1 Parent(s): 6f9fcd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -87,12 +87,12 @@ def bansum(text):
87
  def main():
88
  import streamlit as st
89
  import time
90
- if "photo" not in st.session_state:
91
- st.session_state["photo"]="not done"
92
- def change_photo_state():
93
- st.session_state["photo"]="done"
94
- c1, c2, c3 = st.columns([2,2,1])
95
  if st.checkbox("Summarize"):
 
 
 
 
 
96
  with st.container():
97
  message = c1.text_input("Type your text here!")
98
  uploaded_photo=None
@@ -103,6 +103,7 @@ def main():
103
  CaptureImage =False
104
  if c3.button("Upload Images/PDFs"):
105
  uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
 
106
  Summarize=True
107
  time.sleep(3)
108
  if st.session_state["photo"]=="done" or message:
@@ -165,6 +166,7 @@ def main():
165
  if st.button("English"):
166
  engsum(text)
167
  if st.checkbox("Conversate"):
 
168
  with st.container():
169
  from streamlit_chat import message as st_message
170
  from transformers import BlenderbotTokenizer
 
87
  def main():
88
  import streamlit as st
89
  import time
 
 
 
 
 
90
  if st.checkbox("Summarize"):
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
+ c1, c2, c3 = st.columns([2,2,1])
96
  with st.container():
97
  message = c1.text_input("Type your text here!")
98
  uploaded_photo=None
 
103
  CaptureImage =False
104
  if c3.button("Upload Images/PDFs"):
105
  uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
106
+ global Summarize
107
  Summarize=True
108
  time.sleep(3)
109
  if st.session_state["photo"]=="done" or message:
 
166
  if st.button("English"):
167
  engsum(text)
168
  if st.checkbox("Conversate"):
169
+ Summarize=False
170
  with st.container():
171
  from streamlit_chat import message as st_message
172
  from transformers import BlenderbotTokenizer