-
Notifications
You must be signed in to change notification settings - Fork 0
/
Home.py
59 lines (51 loc) · 1.61 KB
/
Home.py
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
import streamlit as st
from sentence_transformers import SentenceTransformer
import base64
import pandas as pd
#---------------------#
# Streamlit Styling #
#---------------------#
# Apply custom styles using CSS
st.markdown(
"""
<style>
/* Main content background to black and text color to white for contrast */
body {
color: #FFFFFF; /* White text color */
background-color: #000000; /* Black background color */
}
.stApp {
color: #FFFFFF; /* White text color */
background-color: #000000; /* Black background color */
}
/* Sidebar styling */
.sidebar .sidebar-content {
background-color: #FFFFFF; /* White background for the sidebar */
color: #000000; /* Black text color for contrast */
}
</style>
""",
unsafe_allow_html=True,
)
# Hide the hamburger menu
hide_streamlit_style = """
<style>
#MainMenu {visibility: hidden;}
footer {visibility: hidden;}
</style>
"""
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
#---------------------#
# Load embeddings #
#---------------------#
# Load model
@st.cache_resource
def load_model(name):
return SentenceTransformer(name)
st.session_state['en_emb'] = load_model("all-MiniLM-L12-v2")
# st.session_state['multi_emb'] = load_model("stsb-xlm-r-multilingual")
#---------------------#
# Main Page #
#---------------------#
st.title("Prediction Guard Chat Assistant")
st.markdown("Explore our chat with data demo using privacy-conserving AI models from [Prediction Guard](https://www.predictionguard.com/)")