Soumen commited on
Commit
3bed9bf
·
1 Parent(s): f5ad0e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -82,12 +82,13 @@ def bansum(text):
82
  if isinstance(out, list) and out[0].get("summary_text"):
83
  text_output = out[0]["summary_text"]
84
  st.success(text_output)
85
-
 
86
  #@st.cache
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():
@@ -103,9 +104,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
- global Summarize
107
  Summarize=True
108
- time.sleep(3)
109
  if st.session_state["photo"]=="done" or message:
110
  if uploaded_photo and uploaded_photo.type=='application/pdf':
111
  tet = read_pdf(uploaded_photo)
@@ -165,7 +164,7 @@ def main():
165
  bansum(text)
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
 
82
  if isinstance(out, list) and out[0].get("summary_text"):
83
  text_output = out[0]["summary_text"]
84
  st.success(text_output)
85
+ global Summarize
86
+ Summarize=True
87
  #@st.cache
88
  def main():
89
  import streamlit as st
90
  import time
91
+ if st.button("Summarize"):
92
  if "photo" not in st.session_state:
93
  st.session_state["photo"]="not done"
94
  def change_photo_state():
 
104
  CaptureImage =False
105
  if c3.button("Upload Images/PDFs"):
106
  uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
 
107
  Summarize=True
 
108
  if st.session_state["photo"]=="done" or message:
109
  if uploaded_photo and uploaded_photo.type=='application/pdf':
110
  tet = read_pdf(uploaded_photo)
 
164
  bansum(text)
165
  if st.button("English"):
166
  engsum(text)
167
+ if st.button("Chat/Conversate"):
168
  Summarize=False
169
  with st.container():
170
  from streamlit_chat import message as st_message