From d4d7973a46385c15d024fedd73ae121333320b5a Mon Sep 17 00:00:00 2001 From: Garett Tok Ern Liang <36098015+walnutdust@users.noreply.github.com> Date: Mon, 29 Apr 2024 18:26:20 -0700 Subject: [PATCH] fix(pills): Fixed bug with trace view initialization when no feedback functions exist (#1108) --------- Co-authored-by: Josh Reini <60949774+joshreini1@users.noreply.github.com> --- trulens_eval/trulens_eval/pages/Evaluations.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/trulens_eval/trulens_eval/pages/Evaluations.py b/trulens_eval/trulens_eval/pages/Evaluations.py index 6d07ef623..d76349adf 100644 --- a/trulens_eval/trulens_eval/pages/Evaluations.py +++ b/trulens_eval/trulens_eval/pages/Evaluations.py @@ -340,13 +340,17 @@ def get_icon(feedback_name): ) ) - selected_fcol = pills( - "Feedback functions (click on a pill to learn more)", - feedback_with_valid_results, - index=None, - format_func=lambda fcol: f"{fcol} {row[fcol]:.4f}", - icons=icons - ) + selected_fcol = None + if len(feedback_with_valid_results) > 0: + selected_fcol = pills( + "Feedback functions (click on a pill to learn more)", + feedback_with_valid_results, + index=None, + format_func=lambda fcol: f"{fcol} {row[fcol]:.4f}", + icons=icons + ) + else: + st.write("No feedback functions found.") def display_feedback_call(call, feedback_name):