Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,30 +23,23 @@ def add_new_eval(
|
|
23 |
skempi_file,
|
24 |
model_name_textbox: str,
|
25 |
revision_name_textbox: str,
|
26 |
-
|
27 |
similarity_tasks,
|
28 |
function_prediction_aspect,
|
29 |
function_prediction_dataset,
|
30 |
family_prediction_dataset,
|
|
|
31 |
):
|
32 |
representation_name = model_name_textbox if revision_name_textbox == '' else revision_name_textbox
|
33 |
results = run_probe(benchmark_type, representation_name, human_file, skempi_file, similarity_tasks, function_prediction_aspect, function_prediction_dataset, family_prediction_dataset)
|
34 |
|
35 |
print(results)
|
36 |
|
37 |
-
|
|
|
|
|
38 |
|
39 |
-
return
|
40 |
-
|
41 |
-
for benchmark_type in results:
|
42 |
-
if benchmark_type == 'similarity':
|
43 |
-
save_similarity_output(results['similarity'], representation_name)
|
44 |
-
elif benchmark_type == 'function':
|
45 |
-
save_function_output(results['function'], representation_name)
|
46 |
-
elif benchmark_type == 'family':
|
47 |
-
save_family_output(results['family'], representation_name)
|
48 |
-
elif benchmark_type == "affinity":
|
49 |
-
save_affinity_output(results['affinity', representation_name])
|
50 |
|
51 |
# Function to update leaderboard dynamically based on user selection
|
52 |
def update_leaderboard(selected_methods, selected_metrics):
|
@@ -58,7 +51,6 @@ with block:
|
|
58 |
gr.Markdown(LEADERBOARD_INTRODUCTION)
|
59 |
|
60 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
61 |
-
# table jmmmu bench
|
62 |
with gr.TabItem("🏅 PROBE Leaderboard", elem_id="probe-benchmark-tab-table", id=1):
|
63 |
|
64 |
|
@@ -163,9 +155,9 @@ with block:
|
|
163 |
label="Revision Model Name",
|
164 |
)
|
165 |
|
166 |
-
|
167 |
choices=TASK_INFO,
|
168 |
-
label="Benchmark
|
169 |
interactive=True,
|
170 |
)
|
171 |
similarity_tasks = gr.CheckboxGroup(
|
@@ -176,23 +168,28 @@ with block:
|
|
176 |
|
177 |
function_prediction_aspect = gr.Radio(
|
178 |
choices=function_prediction_aspect_options,
|
179 |
-
label="Function Prediction
|
180 |
interactive=True,
|
181 |
)
|
182 |
|
183 |
family_prediction_dataset = gr.CheckboxGroup(
|
184 |
choices=family_prediction_dataset_options,
|
185 |
-
label="Family Prediction
|
186 |
interactive=True,
|
187 |
)
|
188 |
|
189 |
|
190 |
function_dataset = gr.Textbox(
|
191 |
-
label="Function Prediction
|
192 |
visible=False,
|
193 |
value="All_Data_Sets"
|
194 |
)
|
195 |
|
|
|
|
|
|
|
|
|
|
|
196 |
with gr.Column():
|
197 |
human_file = gr.components.File(label="Click to Upload the representation file (csv) for Human dataset", file_count="single", type='filepath')
|
198 |
skempi_file = gr.components.File(label="Click to Upload the representation file (csv) for SKEMPI dataset", file_count="single", type='filepath')
|
@@ -206,11 +203,12 @@ with block:
|
|
206 |
skempi_file,
|
207 |
model_name_textbox,
|
208 |
revision_name_textbox,
|
209 |
-
|
210 |
similarity_tasks,
|
211 |
function_prediction_aspect,
|
212 |
function_dataset,
|
213 |
family_prediction_dataset,
|
|
|
214 |
],
|
215 |
)
|
216 |
|
|
|
23 |
skempi_file,
|
24 |
model_name_textbox: str,
|
25 |
revision_name_textbox: str,
|
26 |
+
benchmark_typse,
|
27 |
similarity_tasks,
|
28 |
function_prediction_aspect,
|
29 |
function_prediction_dataset,
|
30 |
family_prediction_dataset,
|
31 |
+
save,
|
32 |
):
|
33 |
representation_name = model_name_textbox if revision_name_textbox == '' else revision_name_textbox
|
34 |
results = run_probe(benchmark_type, representation_name, human_file, skempi_file, similarity_tasks, function_prediction_aspect, function_prediction_dataset, family_prediction_dataset)
|
35 |
|
36 |
print(results)
|
37 |
|
38 |
+
if save:
|
39 |
+
save_results(representation_name, benchmark_types, results)
|
40 |
+
print("Results are saved!")
|
41 |
|
42 |
+
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
# Function to update leaderboard dynamically based on user selection
|
45 |
def update_leaderboard(selected_methods, selected_metrics):
|
|
|
51 |
gr.Markdown(LEADERBOARD_INTRODUCTION)
|
52 |
|
53 |
with gr.Tabs(elem_classes="tab-buttons") as tabs:
|
|
|
54 |
with gr.TabItem("🏅 PROBE Leaderboard", elem_id="probe-benchmark-tab-table", id=1):
|
55 |
|
56 |
|
|
|
155 |
label="Revision Model Name",
|
156 |
)
|
157 |
|
158 |
+
benchmark_types = gr.CheckboxGroup(
|
159 |
choices=TASK_INFO,
|
160 |
+
label="Benchmark Types",
|
161 |
interactive=True,
|
162 |
)
|
163 |
similarity_tasks = gr.CheckboxGroup(
|
|
|
168 |
|
169 |
function_prediction_aspect = gr.Radio(
|
170 |
choices=function_prediction_aspect_options,
|
171 |
+
label="Function Prediction Aspects",
|
172 |
interactive=True,
|
173 |
)
|
174 |
|
175 |
family_prediction_dataset = gr.CheckboxGroup(
|
176 |
choices=family_prediction_dataset_options,
|
177 |
+
label="Family Prediction Datasets",
|
178 |
interactive=True,
|
179 |
)
|
180 |
|
181 |
|
182 |
function_dataset = gr.Textbox(
|
183 |
+
label="Function Prediction Datasets",
|
184 |
visible=False,
|
185 |
value="All_Data_Sets"
|
186 |
)
|
187 |
|
188 |
+
save_checkbox = gr.Checkbox(
|
189 |
+
label="Save results for leaderboard and visualization",
|
190 |
+
value=True
|
191 |
+
)
|
192 |
+
|
193 |
with gr.Column():
|
194 |
human_file = gr.components.File(label="Click to Upload the representation file (csv) for Human dataset", file_count="single", type='filepath')
|
195 |
skempi_file = gr.components.File(label="Click to Upload the representation file (csv) for SKEMPI dataset", file_count="single", type='filepath')
|
|
|
203 |
skempi_file,
|
204 |
model_name_textbox,
|
205 |
revision_name_textbox,
|
206 |
+
benchmark_types,
|
207 |
similarity_tasks,
|
208 |
function_prediction_aspect,
|
209 |
function_dataset,
|
210 |
family_prediction_dataset,
|
211 |
+
save_checkbox,
|
212 |
],
|
213 |
)
|
214 |
|