Update app.py
Browse files
app.py
CHANGED
@@ -82,13 +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 |
#Summarize=True
|
87 |
#@st.cache
|
88 |
def main():
|
89 |
import streamlit as st
|
90 |
import time
|
91 |
-
if st.
|
92 |
if "photo" not in st.session_state:
|
93 |
st.session_state["photo"]="not done"
|
94 |
def change_photo_state():
|
@@ -98,12 +98,11 @@ def main():
|
|
98 |
message = c1.text_input("Type your text here!")
|
99 |
uploaded_photo=None
|
100 |
camera_photo=None
|
101 |
-
if
|
102 |
-
camera_photo =
|
103 |
-
if
|
104 |
CaptureImage =False
|
105 |
-
|
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':
|
@@ -164,7 +163,7 @@ def main():
|
|
164 |
bansum(text)
|
165 |
if st.button("English"):
|
166 |
engsum(text)
|
167 |
-
if st.
|
168 |
Summarize=False
|
169 |
with st.container():
|
170 |
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 |
+
|
86 |
#Summarize=True
|
87 |
#@st.cache
|
88 |
def main():
|
89 |
import streamlit as st
|
90 |
import time
|
91 |
+
if st.checkbox("Summarize"):
|
92 |
if "photo" not in st.session_state:
|
93 |
st.session_state["photo"]="not done"
|
94 |
def change_photo_state():
|
|
|
98 |
message = c1.text_input("Type your text here!")
|
99 |
uploaded_photo=None
|
100 |
camera_photo=None
|
101 |
+
if c3.button("CaptureImage"):
|
102 |
+
camera_photo = c3.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
103 |
+
if c3.button("Stop camera"):
|
104 |
CaptureImage =False
|
105 |
+
uploaded_photo = c2.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
|
|
|
106 |
#Summarize=True
|
107 |
if st.session_state["photo"]=="done" or message:
|
108 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
|
|
163 |
bansum(text)
|
164 |
if st.button("English"):
|
165 |
engsum(text)
|
166 |
+
if st.checkbox("Chat/Conversate"):
|
167 |
Summarize=False
|
168 |
with st.container():
|
169 |
from streamlit_chat import message as st_message
|