Skip to content

Commit

Permalink
Merge branch 'main' into corey/app_version
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-chu authored Aug 12, 2024
2 parents a2e0fa2 + 153888b commit d9c03c0
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion examples/experimental/db_populate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"\n",
"from trulens.core import Feedback\n",
"from trulens.core import Tru\n",
"from trulens.dashboard import run_dashboard\n",
"from trulens.providers.huggingface.provider import Dummy"
]
},
Expand All @@ -90,7 +91,7 @@
"\n",
"# tru.reset_database()\n",
"\n",
"tru.start_dashboard(force=True, _dev=Path().cwd().parent.parent.resolve())\n",
"run_dashboard(tru, force=True, _dev=Path().cwd().parent.parent.resolve())\n",
"\n",
"Tru().migrate_database()\n",
"\n",
Expand Down
5 changes: 3 additions & 2 deletions examples/experimental/deferred_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"from trulens.core import TruCustomApp\n",
"from trulens.core.schema import FeedbackMode\n",
"from trulens.core.utils.threading import TP\n",
"from trulens.dashboard import run_dashboard\n",
"from trulens.providers.huggingface.provider import Dummy\n",
"\n",
"from examples.expositional.end2end_apps.custom_app.custom_app import CustomApp\n",
Expand All @@ -55,7 +56,7 @@
"\n",
"tru.reset_database()\n",
"\n",
"tru.start_dashboard(force=True, _dev=Path().cwd().parent.parent.resolve())"
"run_dashboard(tru, force=True, _dev=Path().cwd().parent.parent.resolve())"
]
},
{
Expand Down Expand Up @@ -124,7 +125,7 @@
"outputs": [],
"source": [
"# Start the deferred feedback evaluator. This is a non-blocking call. If you are\n",
"# running this in a separate process, make sure you don't exit.\n",
"# running this in a seperate process, make sure you don't exit.\n",
"\n",
"tru.start_evaluator()"
]
Expand Down
3 changes: 2 additions & 1 deletion examples/experimental/dummy_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"from trulens.core import Tru\n",
"from trulens.core import TruCustomApp\n",
"from trulens.core.utils.threading import TP\n",
"from trulens.dashboard import run_dashboard\n",
"from trulens.providers.huggingface.provider import Dummy\n",
"\n",
"from examples.expositional.end2end_apps.custom_app.custom_app import CustomApp\n",
Expand Down Expand Up @@ -78,7 +79,7 @@
"\n",
"# tru.reset_database()\n",
"\n",
"tru.start_dashboard(force=True, _dev=Path().cwd().parent.parent.resolve())"
"run_dashboard(tru, force=True, _dev=Path().cwd().parent.parent.resolve())"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion examples/experimental/streamlit_appui_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
"source": [
"from trulens.core import Tru\n",
"from trulens.core.utils.keys import check_keys\n",
"from trulens.dashboard import run_dashboard\n",
"\n",
"check_keys(\"OPENAI_API_KEY\")\n",
"\n",
"tru = Tru()\n",
"tru.reset_database()\n",
"tru.start_dashboard(force=True, _dev=Path().cwd().parent.parent.resolve())"
"run_dashboard(tru, force=True, _dev=Path().cwd().parent.parent.resolve())"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"from trulens.core import FeedbackMode\n",
"from trulens.core import Select\n",
"from trulens.core import Tru\n",
"from trulens.dashboard import run_dashboard\n",
"\n",
"# Imports main tools:\n",
"from trulens.providers.openai import OpenAI as fOpenAI\n",
Expand All @@ -87,7 +88,7 @@
"\n",
"# Start the dasshboard. If you running from github repo, you will need to adjust\n",
"# the path the dashboard streamlit app starts in by providing the _dev argument.\n",
"tru.start_dashboard(force=True, _dev=Path().cwd().parent.parent.resolve())\n",
"run_dashboard(tru, force=True, _dev=Path().cwd().parent.parent.resolve())\n",
"\n",
"# If needed, you can reset the trulens dashboard database by running the\n",
"# below line:\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"pp = PrettyPrinter()\n",
"\n",
"# Reset the database if needed:\n",
"Tru().reset_database()"
"tru = Tru()\n",
"tru.reset_database()"
]
},
{
Expand Down Expand Up @@ -88,9 +89,8 @@
"metadata": {},
"outputs": [],
"source": [
"proc = Tru().start_dashboard(\n",
" force=True, _dev=Path.cwd().parent.parent.parent.parent\n",
")"
"from trulens.dashboard import run_dashboard\n",
"run_dashboard(tru, force=True, _dev=Path.cwd().parent.parent.parent.parent)\n"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion examples/expositional/use_cases/summarization_eval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"outputs": [],
"source": [
"from trulens.core import Tru\n",
"from trulens.dashboard import run_dashboard\n",
"\n",
"tru = Tru()\n",
"tru.reset_database()\n",
Expand All @@ -206,7 +207,7 @@
"metadata": {},
"outputs": [],
"source": [
"tru.start_dashboard(force=True)"
"run_dashboard(tru, force=True)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/feedback/trulens/feedback/generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def re_configured_rating(

vals = set()
for match in matches:
rating = float(match) if allow_decimal else int(match)
rating = float(match) if allow_decimal else int(float(match))
if min_score_val <= rating <= max_score_val:
vals.add(rating)
else:
Expand Down

0 comments on commit d9c03c0

Please sign in to comment.