Spaces:
Sleeping
Sleeping
SnehaAkula
commited on
Commit
•
8c24c78
1
Parent(s):
1091667
Update app.py
Browse files
app.py
CHANGED
@@ -70,9 +70,9 @@ def main():
|
|
70 |
st.title("Document Content")
|
71 |
file_extension = os.path.splitext(uploaded_file.name)[1].lower()
|
72 |
if file_extension == ".docx":
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
elif file_extension == ".pdf":
|
77 |
images = pdf_to_images(uploaded_file.getvalue())
|
78 |
if images:
|
@@ -88,7 +88,9 @@ def main():
|
|
88 |
if uploaded_file is not None:
|
89 |
response, _ = process_document(uploaded_file, query)
|
90 |
if response:
|
91 |
-
st.write(response)
|
|
|
|
|
92 |
update_conversation(query, response)
|
93 |
else:
|
94 |
st.sidebar.write("Please upload a document first.")
|
|
|
70 |
st.title("Document Content")
|
71 |
file_extension = os.path.splitext(uploaded_file.name)[1].lower()
|
72 |
if file_extension == ".docx":
|
73 |
+
_, document_text = process_document(uploaded_file, "")
|
74 |
+
if document_text is not None:
|
75 |
+
st.text_area("Document Text", value=document_text, height=300)
|
76 |
elif file_extension == ".pdf":
|
77 |
images = pdf_to_images(uploaded_file.getvalue())
|
78 |
if images:
|
|
|
88 |
if uploaded_file is not None:
|
89 |
response, _ = process_document(uploaded_file, query)
|
90 |
if response:
|
91 |
+
# st.write(response)
|
92 |
+
st.write("You:", query)
|
93 |
+
st.write("AI:", response)
|
94 |
update_conversation(query, response)
|
95 |
else:
|
96 |
st.sidebar.write("Please upload a document first.")
|