still trying to make the leaderboard
Browse files
app.py
CHANGED
|
@@ -127,6 +127,9 @@ def get_leaderboard(problem_type: str):
|
|
| 127 |
df = df.sort_values(by=score_field, ascending=True)
|
| 128 |
return df
|
| 129 |
|
|
|
|
|
|
|
|
|
|
| 130 |
def gradio_interface() -> gr.Blocks:
|
| 131 |
with gr.Blocks() as demo:
|
| 132 |
with gr.Tabs(elem_classes="tab-buttons"):
|
|
@@ -155,7 +158,6 @@ def gradio_interface() -> gr.Blocks:
|
|
| 155 |
Upload your plasma boundary JSON and select the problem type to get your score.
|
| 156 |
"""
|
| 157 |
)
|
| 158 |
-
|
| 159 |
user_state = gr.State(value=None)
|
| 160 |
|
| 161 |
gr.LoginButton()
|
|
@@ -163,9 +165,7 @@ def gradio_interface() -> gr.Blocks:
|
|
| 163 |
demo.load(get_user, inputs=None, outputs=user_state)
|
| 164 |
|
| 165 |
with gr.Row():
|
| 166 |
-
problem_type = gr.Dropdown(
|
| 167 |
-
PROBLEM_TYPES, label="Problem Type", value="geometrical"
|
| 168 |
-
)
|
| 169 |
boundary_file = gr.File(label="Boundary JSON File (.json)")
|
| 170 |
|
| 171 |
boundary_file
|
|
@@ -175,6 +175,10 @@ def gradio_interface() -> gr.Blocks:
|
|
| 175 |
submit_boundary,
|
| 176 |
inputs=[problem_type, boundary_file, user_state],
|
| 177 |
outputs=output,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
)
|
| 179 |
'''.then(
|
| 180 |
fn=update_leaderboard,
|
|
|
|
| 127 |
df = df.sort_values(by=score_field, ascending=True)
|
| 128 |
return df
|
| 129 |
|
| 130 |
+
def show_output_box(message):
|
| 131 |
+
return gr.Textbox.update(value=message, visible=True)
|
| 132 |
+
|
| 133 |
def gradio_interface() -> gr.Blocks:
|
| 134 |
with gr.Blocks() as demo:
|
| 135 |
with gr.Tabs(elem_classes="tab-buttons"):
|
|
|
|
| 158 |
Upload your plasma boundary JSON and select the problem type to get your score.
|
| 159 |
"""
|
| 160 |
)
|
|
|
|
| 161 |
user_state = gr.State(value=None)
|
| 162 |
|
| 163 |
gr.LoginButton()
|
|
|
|
| 165 |
demo.load(get_user, inputs=None, outputs=user_state)
|
| 166 |
|
| 167 |
with gr.Row():
|
| 168 |
+
problem_type = gr.Dropdown(PROBLEM_TYPES, label="Problem Type")
|
|
|
|
|
|
|
| 169 |
boundary_file = gr.File(label="Boundary JSON File (.json)")
|
| 170 |
|
| 171 |
boundary_file
|
|
|
|
| 175 |
submit_boundary,
|
| 176 |
inputs=[problem_type, boundary_file, user_state],
|
| 177 |
outputs=output,
|
| 178 |
+
).then(
|
| 179 |
+
fn=show_output_box,
|
| 180 |
+
inputs=[output],
|
| 181 |
+
outputs=[output],
|
| 182 |
)
|
| 183 |
'''.then(
|
| 184 |
fn=update_leaderboard,
|