File size: 2,079 Bytes
7dc774a
 
 
 
 
 
 
 
 
38ff9e9
 
7dc774a
 
 
 
 
38ff9e9
 
 
 
 
 
 
 
7dc774a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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='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()