still trying to make the leaderboard
Browse files
app.py
CHANGED
|
@@ -116,7 +116,7 @@ def write_results(record, result):
|
|
| 116 |
def get_user(profile: gr.OAuthProfile | None) -> str:
|
| 117 |
if profile is None:
|
| 118 |
return "Please login to submit a boundary for evaluation."
|
| 119 |
-
return profile.
|
| 120 |
|
| 121 |
def get_leaderboard(problem_type: str):
|
| 122 |
ds = load_dataset(results_repo, split='train')
|
|
@@ -143,10 +143,10 @@ def gradio_interface() -> gr.Blocks:
|
|
| 143 |
# filter_columns=["T", "Precision", "Model Size"],
|
| 144 |
)
|
| 145 |
|
| 146 |
-
def update_leaderboard(problem_type):
|
| 147 |
-
|
| 148 |
|
| 149 |
-
leaderboard_type.change(fn=update_leaderboard, inputs=leaderboard_type, outputs=leaderboard_df)
|
| 150 |
|
| 151 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
| 152 |
gr.Markdown(
|
|
@@ -169,17 +169,18 @@ def gradio_interface() -> gr.Blocks:
|
|
| 169 |
boundary_file = gr.File(label="Boundary JSON File (.json)")
|
| 170 |
|
| 171 |
boundary_file
|
| 172 |
-
output = gr.Textbox(label="Evaluation Result", lines=10)
|
| 173 |
submit_btn = gr.Button("Evaluate")
|
| 174 |
submit_btn.click(
|
| 175 |
submit_boundary,
|
| 176 |
inputs=[problem_type, boundary_file, user_state],
|
| 177 |
outputs=output,
|
| 178 |
-
)
|
|
|
|
| 179 |
fn=update_leaderboard,
|
| 180 |
inputs=[problem_type],
|
| 181 |
outputs=[leaderboard_df]
|
| 182 |
-
)
|
| 183 |
|
| 184 |
return demo
|
| 185 |
|
|
|
|
| 116 |
def get_user(profile: gr.OAuthProfile | None) -> str:
|
| 117 |
if profile is None:
|
| 118 |
return "Please login to submit a boundary for evaluation."
|
| 119 |
+
return profile.username
|
| 120 |
|
| 121 |
def get_leaderboard(problem_type: str):
|
| 122 |
ds = load_dataset(results_repo, split='train')
|
|
|
|
| 143 |
# filter_columns=["T", "Precision", "Model Size"],
|
| 144 |
)
|
| 145 |
|
| 146 |
+
# def update_leaderboard(problem_type):
|
| 147 |
+
# return get_leaderboard(problem_type)
|
| 148 |
|
| 149 |
+
# leaderboard_type.change(fn=update_leaderboard, inputs=leaderboard_type, outputs=leaderboard_df)
|
| 150 |
|
| 151 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
| 152 |
gr.Markdown(
|
|
|
|
| 169 |
boundary_file = gr.File(label="Boundary JSON File (.json)")
|
| 170 |
|
| 171 |
boundary_file
|
| 172 |
+
output = gr.Textbox(label="Evaluation Result", lines=10, visible=False)
|
| 173 |
submit_btn = gr.Button("Evaluate")
|
| 174 |
submit_btn.click(
|
| 175 |
submit_boundary,
|
| 176 |
inputs=[problem_type, boundary_file, user_state],
|
| 177 |
outputs=output,
|
| 178 |
+
)
|
| 179 |
+
'''.then(
|
| 180 |
fn=update_leaderboard,
|
| 181 |
inputs=[problem_type],
|
| 182 |
outputs=[leaderboard_df]
|
| 183 |
+
)'''
|
| 184 |
|
| 185 |
return demo
|
| 186 |
|