Update app.py
Browse files
app.py
CHANGED
@@ -93,15 +93,19 @@ def main():
|
|
93 |
st.session_state["photo"]="not done"
|
94 |
def change_photo_state():
|
95 |
st.session_state["photo"]="done"
|
96 |
-
c1, c2, c3 = st.columns([2,2,1])
|
97 |
with st.container():
|
98 |
-
message =
|
99 |
uploaded_photo=None
|
100 |
camera_photo=None
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
105 |
#Summarize=True
|
106 |
if st.session_state["photo"]=="done" or message:
|
107 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
|
|
93 |
st.session_state["photo"]="not done"
|
94 |
def change_photo_state():
|
95 |
st.session_state["photo"]="done"
|
96 |
+
c0, c1, c2, c3 = st.columns([2,2,1,1])
|
97 |
with st.container():
|
98 |
+
message = c0.text_input("Type your text here!")
|
99 |
uploaded_photo=None
|
100 |
camera_photo=None
|
101 |
+
if c1.button("Camera"):
|
102 |
+
camera_photo = c1.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
103 |
+
if c1.button("Stop camera"):
|
104 |
+
Camera=False
|
105 |
+
if c2.button("Images"):
|
106 |
+
uploaded_photo = c2.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg'], on_change=change_photo_state)
|
107 |
+
if c3.button("PDF"):
|
108 |
+
uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['pdf'], on_change=change_photo_state)
|
109 |
#Summarize=True
|
110 |
if st.session_state["photo"]=="done" or message:
|
111 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|