Skip to content

Commit

Permalink
Fix import and favicon (#1049)
Browse files Browse the repository at this point in the history
* Fix import and favicon

* Update requirements.txt

---------

Co-authored-by: Josh Reini <[email protected]>
  • Loading branch information
arn-tru and joshreini1 authored Apr 3, 2024
1 parent 99a80e0 commit 3da61a0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
5 changes: 2 additions & 3 deletions trulens_eval/trulens_eval/Leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
from trulens_eval.ux import styles
from trulens_eval.ux.components import draw_metadata

st.set_page_config(page_title="Leaderboard", layout="wide")

from trulens_eval.ux.add_logo import add_logo_and_style_overrides
from trulens_eval.ux.page_config import set_page_config

add_logo_and_style_overrides()
set_page_config(page_title="Leaderboard")

database_url = None

Expand Down
5 changes: 2 additions & 3 deletions trulens_eval/trulens_eval/pages/Apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
# https://github.com/jerryjliu/llama_index/issues/7244:
asyncio.set_event_loop(asyncio.new_event_loop())
import streamlit as st
from ux.add_logo import add_logo_and_style_overrides
from ux.page_config import set_page_config

st.set_page_config(page_title="App Runner", layout="wide")

st.runtime.legacy_caching.clear_cache()

add_logo_and_style_overrides()
set_page_config(page_title="App Runner")


def remove_selector(
Expand Down
9 changes: 4 additions & 5 deletions trulens_eval/trulens_eval/pages/Evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from st_aggrid.shared import GridUpdateMode
from st_aggrid.shared import JsCode
import streamlit as st
from ux.add_logo import add_logo_and_style_overrides
from ux.page_config import set_page_config
from ux.styles import CATEGORY

from trulens_eval import Tru
Expand All @@ -39,13 +39,12 @@
from trulens_eval.ux.components import write_or_json
from trulens_eval.ux.styles import cellstyle_jscode

st.set_page_config(page_title="Evaluations", layout="wide")

st.title("Evaluations")

st.runtime.legacy_caching.clear_cache()

add_logo_and_style_overrides()
set_page_config(page_title="Evaluations")
st.title("Evaluations")


tru = Tru()
lms = tru.db
Expand Down
5 changes: 3 additions & 2 deletions trulens_eval/trulens_eval/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ numpy >= 1.23.5
frozendict >= 2.3.8
munch >= 3.0.0
dill >= 0.3.7
tqdm >= 4.66.1 # groundedness.py
nltk >= 3.8.1 # groundedness.py
tqdm >= 4.66.1 # groundedness.py
nltk >= 3.8.1 # groundedness.py
requests >= 2.31.0
nest-asyncio >= 1.5.8
typing_extensions >= 4.9.0
psutil >= 5.9.8 # tru.py

# Secrets/env management
python-dotenv >= 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
from trulens_eval import __version__


def add_logo_and_style_overrides():
def set_page_config(page_title="TruLens"):

st.set_page_config(page_title=page_title, page_icon="https://www.trulens.org/img/favicon.ico", layout="wide")

logo = open(
pkg_resources.resource_filename('trulens_eval', 'ux/trulens_logo.svg'),
"rb"
Expand Down Expand Up @@ -65,4 +68,5 @@ def add_logo_and_style_overrides():
st.text(f"{__package__}\nv{__version__}")
with user_feedback_col:
st.link_button("Share Feedback", "https://forms.gle/HAc4HBk5nZRpgw7C6", help="Help us improve TruLens!")


0 comments on commit 3da61a0

Please sign in to comment.