still trying to make the leaderboard
Browse files
app.py
CHANGED
@@ -78,11 +78,11 @@ def submit_boundary(
|
|
78 |
write_results(record, result)
|
79 |
output = str(result)
|
80 |
except Exception as e:
|
81 |
-
|
82 |
finally:
|
83 |
tmp_boundary_path.unlink()
|
84 |
|
85 |
-
return
|
86 |
|
87 |
def read_boundary(filename):
|
88 |
local_path = hf_hub_download(
|
@@ -147,6 +147,12 @@ def gradio_interface() -> gr.Blocks:
|
|
147 |
hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json", "evaluated"],
|
148 |
# filter_columns=["T", "Precision", "Model Size"],
|
149 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
151 |
gr.Markdown(
|
152 |
"""
|
@@ -174,9 +180,12 @@ def gradio_interface() -> gr.Blocks:
|
|
174 |
submit_boundary,
|
175 |
inputs=[problem_type, boundary_file, user_state],
|
176 |
outputs=output,
|
|
|
|
|
|
|
|
|
177 |
)
|
178 |
-
|
179 |
-
|
180 |
return demo
|
181 |
|
182 |
|
|
|
78 |
write_results(record, result)
|
79 |
output = str(result)
|
80 |
except Exception as e:
|
81 |
+
raise gr.Error(f"Error during evaluation:\n{e}")
|
82 |
finally:
|
83 |
tmp_boundary_path.unlink()
|
84 |
|
85 |
+
return "✅ Your submission has been received! Sit tight and your scores will appear on the leaderboard shortly."
|
86 |
|
87 |
def read_boundary(filename):
|
88 |
local_path = hf_hub_download(
|
|
|
147 |
hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json", "evaluated"],
|
148 |
# filter_columns=["T", "Precision", "Model Size"],
|
149 |
)
|
150 |
+
|
151 |
+
def update_leaderboard(problem_type):
|
152 |
+
return get_leaderboard(problem_type)
|
153 |
+
|
154 |
+
leaderboard_type.change(fn=update_leaderboard, inputs=leaderboard_type, outputs=leaderboard_df)
|
155 |
+
|
156 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
157 |
gr.Markdown(
|
158 |
"""
|
|
|
180 |
submit_boundary,
|
181 |
inputs=[problem_type, boundary_file, user_state],
|
182 |
outputs=output,
|
183 |
+
).then(
|
184 |
+
fn=update_leaderboard,
|
185 |
+
inputs=[problem_type],
|
186 |
+
outputs=[leaderboard_df]
|
187 |
)
|
188 |
+
|
|
|
189 |
return demo
|
190 |
|
191 |
|