Update app.py
Browse files
app.py
CHANGED
@@ -82,10 +82,6 @@ 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 load(x):
|
88 |
-
return x
|
89 |
|
90 |
""" NLP Based Application with Streamlit """
|
91 |
if "photo" not in st.session_state:
|
@@ -93,9 +89,9 @@ if "photo" not in st.session_state:
|
|
93 |
def change_photo_state():
|
94 |
st.session_state["photo"]="done"
|
95 |
message = st.text_input("Type your text here!")
|
96 |
-
c2, c3 = st.columns([2,1])
|
97 |
-
|
98 |
-
|
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)
|
|
|
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 |
""" NLP Based Application with Streamlit """
|
87 |
if "photo" not in st.session_state:
|
|
|
89 |
def change_photo_state():
|
90 |
st.session_state["photo"]="done"
|
91 |
message = st.text_input("Type your text here!")
|
92 |
+
c2, c3 = st.columns([2.5,1])
|
93 |
+
camera_photo = c2.camera_input("Capture a photo to summarize: ", on_change=change_photo_state)
|
94 |
+
uploaded_photo = c3.file_uploader("Upload your Images/PDF",type=['jpg','png','jpeg','pdf'], on_change=change_photo_state)
|
95 |
if st.session_state["photo"]=="done" or message:
|
96 |
if uploaded_photo and uploaded_photo.type=='application/pdf':
|
97 |
tet = read_pdf(uploaded_photo)
|