Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,6 +36,18 @@ def add_new_eval(
|
|
| 36 |
save,
|
| 37 |
):
|
| 38 |
"""Validate inputs, run evaluation and (optionally) save results."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
if any(task in benchmark_types for task in ['similarity', 'family', 'function']) and human_file is None:
|
| 40 |
gr.Warning("Human representations are required for similarity, family, or function benchmarks!")
|
| 41 |
return -1
|
|
@@ -172,10 +184,10 @@ with block:
|
|
| 172 |
metric_names = leaderboard.columns.tolist(); metric_names.remove('Method')
|
| 173 |
|
| 174 |
benchmark_metric_mapping = {
|
| 175 |
-
"
|
| 176 |
-
"
|
| 177 |
-
"
|
| 178 |
-
"
|
| 179 |
}
|
| 180 |
|
| 181 |
leaderboard_method_selector = gr.CheckboxGroup(
|
|
|
|
| 36 |
save,
|
| 37 |
):
|
| 38 |
"""Validate inputs, run evaluation and (optionally) save results."""
|
| 39 |
+
|
| 40 |
+
# map the user‐facing labels back to the original codes
|
| 41 |
+
try:
|
| 42 |
+
benchmark_types_mapped = [benchmark_type_map[b] for b in benchmark_types]
|
| 43 |
+
similarity_tasks_mapped = [similarity_tasks_map[s] for s in similarity_tasks]
|
| 44 |
+
function_prediction_aspect_mapped = function_prediction_aspect_map[function_prediction_aspect]
|
| 45 |
+
family_prediction_dataset_mapped = [family_prediction_dataset_map[f] for f in family_prediction_dataset]
|
| 46 |
+
except KeyError as e:
|
| 47 |
+
gr.Warning(f"Unrecognized option: {e.args[0]}")
|
| 48 |
+
return -1
|
| 49 |
+
|
| 50 |
+
# validate inputs
|
| 51 |
if any(task in benchmark_types for task in ['similarity', 'family', 'function']) and human_file is None:
|
| 52 |
gr.Warning("Human representations are required for similarity, family, or function benchmarks!")
|
| 53 |
return -1
|
|
|
|
| 184 |
metric_names = leaderboard.columns.tolist(); metric_names.remove('Method')
|
| 185 |
|
| 186 |
benchmark_metric_mapping = {
|
| 187 |
+
"Semantic Similarity": [m for m in metric_names if m.startswith('sim_')],
|
| 188 |
+
"GO-Based Function Prediction": [m for m in metric_names if m.startswith('func')],
|
| 189 |
+
"Target Protein Family Prediction": [m for m in metric_names if m.startswith('fam_')],
|
| 190 |
+
"Protein Protein Binding Affinity": [m for m in metric_names if m.startswith('aff_')],
|
| 191 |
}
|
| 192 |
|
| 193 |
leaderboard_method_selector = gr.CheckboxGroup(
|