Spaces:
Running
Running
update column filter
Browse files- app.py +12 -8
- src/display/utils.py +3 -1
app.py
CHANGED
@@ -131,16 +131,20 @@ def filter_llm_provider_func(df: pd.DataFrame, llm_provider_query: list) -> pd.D
|
|
131 |
return df[df["LLM Provider"].isin(llm_provider_query)]
|
132 |
|
133 |
|
134 |
-
def filter_metric_area_func(df: pd.DataFrame, metric_area_query: list) -> pd.DataFrame:
|
135 |
-
return df[df["Metric Area"].isin(metric_area_query)]
|
136 |
-
|
137 |
-
|
138 |
def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
139 |
-
always_here_cols = [
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
]
|
142 |
-
# We use COLS to maintain sorting
|
143 |
-
filtered_df = df[always_here_cols + [c for c in COLS if c in df.columns and c in columns]]
|
144 |
return filtered_df
|
145 |
|
146 |
|
|
|
131 |
return df[df["LLM Provider"].isin(llm_provider_query)]
|
132 |
|
133 |
|
|
|
|
|
|
|
|
|
134 |
def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
135 |
+
# always_here_cols = [
|
136 |
+
# AutoEvalColumn.model.name,
|
137 |
+
# ]
|
138 |
+
model_provider_col = [AutoEvalColumn.model_provider.name] if AutoEvalColumn.model_provider.name in columns else []
|
139 |
+
# We use COLS to maintain sortingx
|
140 |
+
filtered_df = df[
|
141 |
+
(
|
142 |
+
[AutoEvalColumn.model.name]
|
143 |
+
+ model_provider_col
|
144 |
+
+ [AutoEvalColumn.use_case_name.name]
|
145 |
+
+ [c for c in COLS if c in df.columns and c in columns and c != AutoEvalColumn.model_provider.name]
|
146 |
+
)
|
147 |
]
|
|
|
|
|
148 |
return filtered_df
|
149 |
|
150 |
|
src/display/utils.py
CHANGED
@@ -26,7 +26,9 @@ auto_eval_column_dict.append(
|
|
26 |
["model", ColumnContent, ColumnContent("Model Name", "markdown", True, never_hidden=True)]
|
27 |
)
|
28 |
auto_eval_column_dict.append(["model_provider", ColumnContent, ColumnContent("LLM Provider", "markdown", True)])
|
29 |
-
auto_eval_column_dict.append(
|
|
|
|
|
30 |
auto_eval_column_dict.append(["use_case_type", ColumnContent, ColumnContent("Use Case Type", "markdown", False)])
|
31 |
auto_eval_column_dict.append(
|
32 |
["accuracy_method", ColumnContent, ColumnContent("Accuracy Method", "markdown", False, never_hidden=True)]
|
|
|
26 |
["model", ColumnContent, ColumnContent("Model Name", "markdown", True, never_hidden=True)]
|
27 |
)
|
28 |
auto_eval_column_dict.append(["model_provider", ColumnContent, ColumnContent("LLM Provider", "markdown", True)])
|
29 |
+
auto_eval_column_dict.append(
|
30 |
+
["use_case_name", ColumnContent, ColumnContent("Use Case Name", "markdown", True, never_hidden=True)]
|
31 |
+
)
|
32 |
auto_eval_column_dict.append(["use_case_type", ColumnContent, ColumnContent("Use Case Type", "markdown", False)])
|
33 |
auto_eval_column_dict.append(
|
34 |
["accuracy_method", ColumnContent, ColumnContent("Accuracy Method", "markdown", False, never_hidden=True)]
|