Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Add Configs tab
Browse files
app.py
CHANGED
|
@@ -52,7 +52,8 @@ def load_result(model_id):
|
|
| 52 |
df = to_dataframe(data)
|
| 53 |
result = [
|
| 54 |
to_vertical(df),
|
| 55 |
-
to_vertical(filter_results(df))
|
|
|
|
| 56 |
]
|
| 57 |
return result
|
| 58 |
|
|
@@ -78,6 +79,13 @@ def filter_results(df):
|
|
| 78 |
return df
|
| 79 |
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
def concat_result_1(result_1, results):
|
| 82 |
return pd.concat([result_1, results.iloc[:, [0, 2]].set_index("Parameters")], axis=1).reset_index()
|
| 83 |
|
|
@@ -129,6 +137,14 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 129 |
column_widths=["30%", "30%", "30%"],
|
| 130 |
wrap=True,
|
| 131 |
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
load_btn_1.click(
|
| 134 |
fn=render_result_1,
|
|
|
|
| 52 |
df = to_dataframe(data)
|
| 53 |
result = [
|
| 54 |
to_vertical(df),
|
| 55 |
+
to_vertical(filter_results(df)),
|
| 56 |
+
to_vertical(filter_configs(df)),
|
| 57 |
]
|
| 58 |
return result
|
| 59 |
|
|
|
|
| 79 |
return df
|
| 80 |
|
| 81 |
|
| 82 |
+
def filter_configs(df):
|
| 83 |
+
df = df.loc[:, df.columns.str[0] == "configs"]
|
| 84 |
+
# df = df.loc[:, ~df.columns.str[1].isin(EXCLUDED_RESULTS_KEYS)]
|
| 85 |
+
# df = df.loc[:, ~df.columns.str[2].isin(EXCLUDED_RESULTS_LEADERBOARDS_KEYS)]
|
| 86 |
+
return df
|
| 87 |
+
|
| 88 |
+
|
| 89 |
def concat_result_1(result_1, results):
|
| 90 |
return pd.concat([result_1, results.iloc[:, [0, 2]].set_index("Parameters")], axis=1).reset_index()
|
| 91 |
|
|
|
|
| 137 |
column_widths=["30%", "30%", "30%"],
|
| 138 |
wrap=True,
|
| 139 |
))
|
| 140 |
+
with gr.Tab("Configs"):
|
| 141 |
+
results.append(gr.Dataframe(
|
| 142 |
+
label="Results",
|
| 143 |
+
headers=["Parameters", "Model-1", "Model-2"],
|
| 144 |
+
interactive=False,
|
| 145 |
+
column_widths=["30%", "30%", "30%"],
|
| 146 |
+
wrap=True,
|
| 147 |
+
))
|
| 148 |
|
| 149 |
load_btn_1.click(
|
| 150 |
fn=render_result_1,
|