From 5c3d135ca893882051d39596a3088467f20eb8fc Mon Sep 17 00:00:00 2001 From: "min.tian" Date: Wed, 21 Jun 2023 18:00:07 +0800 Subject: [PATCH] fix bugs: display case_name and case_description Signed-off-by: min.tian --- vectordb_bench/backend/cases.py | 7 +++++++ .../frontend/components/run_test/caseSelector.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/vectordb_bench/backend/cases.py b/vectordb_bench/backend/cases.py index 09c91852f..70f8f7f11 100644 --- a/vectordb_bench/backend/cases.py +++ b/vectordb_bench/backend/cases.py @@ -44,6 +44,13 @@ def case_name(self) -> str: if c is not None: return c().name raise ValueError("Case unsupported") + + @property + def case_description(self) -> str: + c = self.case_cls + if c is not None: + return c().description + raise ValueError("Case unsupported") class CaseLabel(Enum): diff --git a/vectordb_bench/frontend/components/run_test/caseSelector.py b/vectordb_bench/frontend/components/run_test/caseSelector.py index 26de62828..5dfc672bb 100644 --- a/vectordb_bench/frontend/components/run_test/caseSelector.py +++ b/vectordb_bench/frontend/components/run_test/caseSelector.py @@ -33,9 +33,9 @@ def caseSelector(st, activedDbList): def caseItem(st, allCaseConfigs, case: CaseType, activedDbList): - selected = st.checkbox(case.casename) + selected = st.checkbox(case.case_name) st.markdown( - f"
{case.get()().description}
", + f"
{case.case_description}
", unsafe_allow_html=True, )