Update app.py
Browse files
app.py
CHANGED
|
@@ -88,11 +88,14 @@ if "photo" not in st.session_state:
|
|
| 88 |
c2, c3 = st.columns([2,1])
|
| 89 |
def change_photo_state():
|
| 90 |
st.session_state["photo"]="done"
|
|
|
|
|
|
|
|
|
|
| 91 |
#@st.cache
|
| 92 |
def main():
|
| 93 |
message = st.text_input("Type your text here!")
|
| 94 |
camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
| 95 |
-
uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
|
| 96 |
if st.session_state["photo"]=="done" or message:
|
| 97 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
| 98 |
tet = read_pdf(uploaded_photo)
|
|
|
|
| 88 |
c2, c3 = st.columns([2,1])
|
| 89 |
def change_photo_state():
|
| 90 |
st.session_state["photo"]="done"
|
| 91 |
+
@st.cache
|
| 92 |
+
def save(l):
|
| 93 |
+
return l
|
| 94 |
#@st.cache
|
| 95 |
def main():
|
| 96 |
message = st.text_input("Type your text here!")
|
| 97 |
camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
| 98 |
+
uploaded_photo = save(c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state))
|
| 99 |
if st.session_state["photo"]=="done" or message:
|
| 100 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
| 101 |
tet = read_pdf(uploaded_photo)
|