From 55e7c0a9e463800b6fd9f2da04a2b72801876999 Mon Sep 17 00:00:00 2001 From: largelanguagemodels <132989246+largelanguagemodels@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:32:15 -0700 Subject: [PATCH] Update chatbot_comparator.py Adding doctoring to visualize method for comparison --- pykoi/component/chatbot_comparator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pykoi/component/chatbot_comparator.py b/pykoi/component/chatbot_comparator.py index c75fe8d..09ffc64 100644 --- a/pykoi/component/chatbot_comparator.py +++ b/pykoi/component/chatbot_comparator.py @@ -47,7 +47,7 @@ def __init__(self, models: List[AbsLlm], **kwargs): "latency", "length_in_tokens", ] - ) # Added this line + ) def add(self, model: AbsLlm): """ @@ -118,5 +118,13 @@ def inference(self, questions: List[str]): return self.inference_results def visualize(self): + """ + Visualize the inference results using a bar chart. + + Returns + ------- + object + A Barchart visualization with the inference results. + """ records = df_to_js_array(self.inference_results) return Barchart()(data=records)