Update app.py
Browse files
app.py
CHANGED
|
@@ -83,9 +83,9 @@ def bansum(text):
|
|
| 83 |
text_output = out[0]["summary_text"]
|
| 84 |
st.success(text_output)
|
| 85 |
|
| 86 |
-
@st.cache
|
| 87 |
-
def save(l):
|
| 88 |
-
|
| 89 |
#@st.cache
|
| 90 |
def main():
|
| 91 |
camera_photo=None
|
|
@@ -97,12 +97,12 @@ def main():
|
|
| 97 |
with st.container():
|
| 98 |
c1, c2, c3 = st.columns([2,2,1])
|
| 99 |
message = c1.text_input("Type your text here!")
|
| 100 |
-
|
| 101 |
-
|
| 102 |
#st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
uploaded_photo =
|
| 106 |
if st.session_state["photo"]=="done" or message:
|
| 107 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
| 108 |
tet = read_pdf(uploaded_photo)
|
|
|
|
| 83 |
text_output = out[0]["summary_text"]
|
| 84 |
st.success(text_output)
|
| 85 |
|
| 86 |
+
# @st.cache
|
| 87 |
+
# def save(l):
|
| 88 |
+
# return l
|
| 89 |
#@st.cache
|
| 90 |
def main():
|
| 91 |
camera_photo=None
|
|
|
|
| 97 |
with st.container():
|
| 98 |
c1, c2, c3 = st.columns([2,2,1])
|
| 99 |
message = c1.text_input("Type your text here!")
|
| 100 |
+
if st.button("CaptureImage"):
|
| 101 |
+
camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
| 102 |
#st.image(camera_photo, caption='Uploaded Image', use_column_width=True)
|
| 103 |
+
if st.button("Stop camera"):
|
| 104 |
+
CaptureImage =False
|
| 105 |
+
uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
|
| 106 |
if st.session_state["photo"]=="done" or message:
|
| 107 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
| 108 |
tet = read_pdf(uploaded_photo)
|