Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from upload_main import upload_main_page | |
| from upload_image_page import upload | |
| from view_images import view_images | |
| from search_page import search | |
| from upload_pdf_page import upload_pdf | |
| from view_pdf import view_pdfs | |
| st.set_page_config(layout='wide',page_title="MoSPI", page_icon="📄") | |
| path_to_logo=r"logo.png" | |
| if "page" not in st.session_state: | |
| st.session_state.page = "home" | |
| if st.session_state.page == "home": | |
| # Title and Header | |
| col1, col2 = st.columns([1, 14]) | |
| with col1: | |
| # Insert logo (replace 'logo.png' with the path or URL to your logo) | |
| st.image(path_to_logo, width=100) # Adjust width as needed | |
| with col2: | |
| st.title("Welcome to AI Assistant! Your Intelligent Search Partner.") | |
| # Message paragraph | |
| st.write(""" | |
| We bring you AI-innovated smart search, which supports multilingual and voice search to streamline your searches. | |
| """) | |
| st.subheader("Key Features") | |
| st.markdown(""" | |
| - **Semantic search** across PDFs, images, and official documents. | |
| - **Quick, relevant responses** with document page highlights. | |
| - **Multilingual and voice-based search** capabilities. | |
| - **Integration with company’s data systems** for high relevance. | |
| """) | |
| st.markdown("<hr>", unsafe_allow_html=True) | |
| # Buttons for Search and Upload | |
| col1, col2 = st.columns([1,7]) | |
| with col1: | |
| if st.button("Search",help="Smart Search"): | |
| st.session_state.page = "search" | |
| st.rerun() | |
| with col2: | |
| if st.button("Upload PDF/Images",help="Upload PDFs and Images"): | |
| st.session_state.page = "upload_main" | |
| st.rerun() | |
| elif st.session_state.page == "upload_main": | |
| upload_main_page() | |
| elif st.session_state.page == "upload_image": | |
| upload() # Render the image upload function | |
| elif st.session_state.page=="view_image": | |
| view_images() | |
| elif st.session_state.page=="search": | |
| search() | |
| elif st.session_state.page=="upload_pdf": | |
| upload_pdf() | |
| elif st.session_state.page=="view_pdf": | |
| view_pdfs() | |