Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,74 +1,74 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
from upload_main import upload_main_page
|
| 3 |
-
from upload_image_page import upload
|
| 4 |
-
from view_images import view_images
|
| 5 |
-
from search_page import search
|
| 6 |
-
from upload_pdf_page import upload_pdf
|
| 7 |
-
from view_pdf import view_pdfs
|
| 8 |
-
st.set_page_config(layout='wide',page_title="MoSPI", page_icon="📄")
|
| 9 |
-
path_to_logo=r"
|
| 10 |
-
if "page" not in st.session_state:
|
| 11 |
-
st.session_state.page = "home"
|
| 12 |
-
|
| 13 |
-
if st.session_state.page == "home":
|
| 14 |
-
# Title and Header
|
| 15 |
-
col1, col2 = st.columns([1, 14])
|
| 16 |
-
|
| 17 |
-
with col1:
|
| 18 |
-
# Insert logo (replace 'logo.png' with the path or URL to your logo)
|
| 19 |
-
st.image(path_to_logo, width=100) # Adjust width as needed
|
| 20 |
-
|
| 21 |
-
with col2:
|
| 22 |
-
st.title("Welcome to AI Assistant! Your Intelligent Search Partner.")
|
| 23 |
-
|
| 24 |
-
# Message paragraph
|
| 25 |
-
st.write("""
|
| 26 |
-
We bring you AI-innovated smart search, which supports multilingual and voice search to streamline your searches.
|
| 27 |
-
""")
|
| 28 |
-
|
| 29 |
-
st.subheader("Key Features")
|
| 30 |
-
st.markdown("""
|
| 31 |
-
- **Semantic search** across PDFs, images, and official documents.
|
| 32 |
-
- **Quick, relevant responses** with document page highlights.
|
| 33 |
-
- **Multilingual and voice-based search** capabilities.
|
| 34 |
-
- **Integration with company’s data systems** for high relevance.
|
| 35 |
-
""")
|
| 36 |
-
|
| 37 |
-
st.markdown("<hr>", unsafe_allow_html=True)
|
| 38 |
-
# Buttons for Search and Upload
|
| 39 |
-
col1, col2 = st.columns([1,7])
|
| 40 |
-
|
| 41 |
-
with col1:
|
| 42 |
-
if st.button("Search",help="Smart Search"):
|
| 43 |
-
st.session_state.page = "search"
|
| 44 |
-
st.rerun()
|
| 45 |
-
|
| 46 |
-
with col2:
|
| 47 |
-
if st.button("Upload PDF/Images",help="Upload PDFs and Images"):
|
| 48 |
-
st.session_state.page = "upload_main"
|
| 49 |
-
st.rerun()
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
elif st.session_state.page == "upload_main":
|
| 53 |
-
upload_main_page()
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
elif st.session_state.page == "upload_image":
|
| 57 |
-
upload() # Render the image upload function
|
| 58 |
-
|
| 59 |
-
elif st.session_state.page=="view_image":
|
| 60 |
-
view_images()
|
| 61 |
-
|
| 62 |
-
elif st.session_state.page=="search":
|
| 63 |
-
search()
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
elif st.session_state.page=="upload_pdf":
|
| 67 |
-
upload_pdf()
|
| 68 |
-
|
| 69 |
-
elif st.session_state.page=="view_pdf":
|
| 70 |
-
view_pdfs()
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from upload_main import upload_main_page
|
| 3 |
+
from upload_image_page import upload
|
| 4 |
+
from view_images import view_images
|
| 5 |
+
from search_page import search
|
| 6 |
+
from upload_pdf_page import upload_pdf
|
| 7 |
+
from view_pdf import view_pdfs
|
| 8 |
+
st.set_page_config(layout='wide',page_title="MoSPI", page_icon="📄")
|
| 9 |
+
path_to_logo=r"logo.png"
|
| 10 |
+
if "page" not in st.session_state:
|
| 11 |
+
st.session_state.page = "home"
|
| 12 |
+
|
| 13 |
+
if st.session_state.page == "home":
|
| 14 |
+
# Title and Header
|
| 15 |
+
col1, col2 = st.columns([1, 14])
|
| 16 |
+
|
| 17 |
+
with col1:
|
| 18 |
+
# Insert logo (replace 'logo.png' with the path or URL to your logo)
|
| 19 |
+
st.image(path_to_logo, width=100) # Adjust width as needed
|
| 20 |
+
|
| 21 |
+
with col2:
|
| 22 |
+
st.title("Welcome to AI Assistant! Your Intelligent Search Partner.")
|
| 23 |
+
|
| 24 |
+
# Message paragraph
|
| 25 |
+
st.write("""
|
| 26 |
+
We bring you AI-innovated smart search, which supports multilingual and voice search to streamline your searches.
|
| 27 |
+
""")
|
| 28 |
+
|
| 29 |
+
st.subheader("Key Features")
|
| 30 |
+
st.markdown("""
|
| 31 |
+
- **Semantic search** across PDFs, images, and official documents.
|
| 32 |
+
- **Quick, relevant responses** with document page highlights.
|
| 33 |
+
- **Multilingual and voice-based search** capabilities.
|
| 34 |
+
- **Integration with company’s data systems** for high relevance.
|
| 35 |
+
""")
|
| 36 |
+
|
| 37 |
+
st.markdown("<hr>", unsafe_allow_html=True)
|
| 38 |
+
# Buttons for Search and Upload
|
| 39 |
+
col1, col2 = st.columns([1,7])
|
| 40 |
+
|
| 41 |
+
with col1:
|
| 42 |
+
if st.button("Search",help="Smart Search"):
|
| 43 |
+
st.session_state.page = "search"
|
| 44 |
+
st.rerun()
|
| 45 |
+
|
| 46 |
+
with col2:
|
| 47 |
+
if st.button("Upload PDF/Images",help="Upload PDFs and Images"):
|
| 48 |
+
st.session_state.page = "upload_main"
|
| 49 |
+
st.rerun()
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
elif st.session_state.page == "upload_main":
|
| 53 |
+
upload_main_page()
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
elif st.session_state.page == "upload_image":
|
| 57 |
+
upload() # Render the image upload function
|
| 58 |
+
|
| 59 |
+
elif st.session_state.page=="view_image":
|
| 60 |
+
view_images()
|
| 61 |
+
|
| 62 |
+
elif st.session_state.page=="search":
|
| 63 |
+
search()
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
elif st.session_state.page=="upload_pdf":
|
| 67 |
+
upload_pdf()
|
| 68 |
+
|
| 69 |
+
elif st.session_state.page=="view_pdf":
|
| 70 |
+
view_pdfs()
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|