Spaces:
Running
Running
File size: 1,441 Bytes
dec332b |
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 |
import base64
import pkg_resources
import streamlit as st
from trulens_eval import __package__
from trulens_eval import __version__
def add_logo_and_style_overrides():
logo = open(
pkg_resources.resource_filename('trulens_eval', 'ux/trulens_logo.svg'),
"rb"
).read()
logo_encoded = base64.b64encode(logo).decode()
st.markdown(
f"""
<style>
[data-testid="stSidebarNav"] {{
background-image: url('data:image/svg+xml;base64,{logo_encoded}');
background-repeat: no-repeat;
background-size: 300px auto;
padding-top: 50px;
background-position: 20px 20px;
}}
[data-testid="stSidebarNav"]::before {{
margin-left: 20px;
margin-top: 20px;
font-size: 30px;
position: relative;
top: 100px;
}}
[data-testid="stSidebarNav"]::after {{
margin-left: 20px;
color: #aaaaaa;
content: "{__package__} {__version__}";
font-size: 10pt;
}}
/* For list items in st.dataframe */
#portal .clip-region .boe-bubble {{
height: auto;
border-radius: 4px;
padding: 8px;
}}
</style>
""",
unsafe_allow_html=True,
)
|