still trying to make the leaderboard
Browse files- app.py +11 -5
- visualize.py +3 -2
app.py
CHANGED
@@ -6,7 +6,7 @@ import json
|
|
6 |
import pandas as pd
|
7 |
|
8 |
import gradio as gr
|
9 |
-
from datasets import load_dataset
|
10 |
from huggingface_hub import upload_file, hf_hub_download
|
11 |
from gradio_leaderboard import ColumnFilter, Leaderboard, SelectColumns
|
12 |
from evaluation import evaluate_problem
|
@@ -50,13 +50,20 @@ def gradio_interface() -> gr.Blocks:
|
|
50 |
select_columns=["submission_time", "feasibility", "score", "objective", "user"],
|
51 |
search_columns=["submission_time", "score", "user"],
|
52 |
hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json", "evaluated"],
|
53 |
-
filter_columns=["problem_type"
|
54 |
)
|
55 |
|
56 |
# def update_leaderboard(problem_type):
|
57 |
# return get_leaderboard(problem_type)
|
58 |
|
59 |
# leaderboard_type.change(fn=update_leaderboard, inputs=leaderboard_type, outputs=leaderboard_df)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
62 |
gr.Markdown(
|
@@ -88,13 +95,12 @@ def gradio_interface() -> gr.Blocks:
|
|
88 |
fn=show_output_box,
|
89 |
inputs=[message],
|
90 |
outputs=[message],
|
91 |
-
)
|
92 |
-
'''.then(
|
93 |
fn=evaluate_boundary,
|
94 |
inputs=[filename],
|
95 |
outputs=[eval_state]
|
96 |
)
|
97 |
-
.then(
|
98 |
fn=update_leaderboard,
|
99 |
inputs=[problem_type],
|
100 |
outputs=[leaderboard_df]
|
|
|
6 |
import pandas as pd
|
7 |
|
8 |
import gradio as gr
|
9 |
+
from datasets import load_dataset
|
10 |
from huggingface_hub import upload_file, hf_hub_download
|
11 |
from gradio_leaderboard import ColumnFilter, Leaderboard, SelectColumns
|
12 |
from evaluation import evaluate_problem
|
|
|
50 |
select_columns=["submission_time", "feasibility", "score", "objective", "user"],
|
51 |
search_columns=["submission_time", "score", "user"],
|
52 |
hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json", "evaluated"],
|
53 |
+
filter_columns=["problem_type"],
|
54 |
)
|
55 |
|
56 |
# def update_leaderboard(problem_type):
|
57 |
# return get_leaderboard(problem_type)
|
58 |
|
59 |
# leaderboard_type.change(fn=update_leaderboard, inputs=leaderboard_type, outputs=leaderboard_df)
|
60 |
+
with gr.TabItem("About", elem_id="boundary-benchmark-tab-table"):
|
61 |
+
gr.Markdown(
|
62 |
+
"""
|
63 |
+
# Welcome to the Fusion Challenge!
|
64 |
+
Upload your plasma boundary JSON and select the problem type to get your score.
|
65 |
+
"""
|
66 |
+
)
|
67 |
|
68 |
with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
|
69 |
gr.Markdown(
|
|
|
95 |
fn=show_output_box,
|
96 |
inputs=[message],
|
97 |
outputs=[message],
|
98 |
+
).then(
|
|
|
99 |
fn=evaluate_boundary,
|
100 |
inputs=[filename],
|
101 |
outputs=[eval_state]
|
102 |
)
|
103 |
+
'''.then(
|
104 |
fn=update_leaderboard,
|
105 |
inputs=[problem_type],
|
106 |
outputs=[leaderboard_df]
|
visualize.py
CHANGED
@@ -6,5 +6,6 @@ from constellaration.utils import (
|
|
6 |
import plotly.express as px
|
7 |
|
8 |
def make_visual(boundary):
|
9 |
-
visualization.plot_surface(boundary)
|
10 |
-
|
|
|
|
6 |
import plotly.express as px
|
7 |
|
8 |
def make_visual(boundary):
|
9 |
+
vis = visualization.plot_surface(boundary)
|
10 |
+
div = vis.to_html(full_html=False)
|
11 |
+
return div
|