Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,16 +2,16 @@ import gradio as gr
|
|
2 |
import pandas as pd
|
3 |
from apscheduler.schedulers.background import BackgroundScheduler
|
4 |
|
5 |
-
"""
|
6 |
-
MLEβDojo Leaderboard (v2.
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
#
|
13 |
-
# 0οΈβ£
|
14 |
-
#
|
15 |
try:
|
16 |
from src.about import (
|
17 |
CITATION_BUTTON_LABEL,
|
@@ -22,7 +22,7 @@ try:
|
|
22 |
)
|
23 |
from src.display.css_html_js import custom_css as EXTRA_CSS
|
24 |
from src.envs import REPO_ID
|
25 |
-
from src.submission.submit import add_new_eval
|
26 |
print("β Imported projectβlocal definitions from src.*")
|
27 |
except ImportError:
|
28 |
print("β src.* imports failed β using internal placeholders.")
|
@@ -36,9 +36,9 @@ except ImportError:
|
|
36 |
def add_new_eval(*_):
|
37 |
return "Submission placeholder."
|
38 |
|
39 |
-
#
|
40 |
-
# 1οΈβ£
|
41 |
-
#
|
42 |
MODELS = [
|
43 |
{"model_name": "gpt-4o-mini", "url": "https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/", "organizer": "OpenAI", "license": "Proprietary", "MLE-Lite_Elo": 753, "Tabular_Elo": 839, "NLP_Elo": 758, "CV_Elo": 754, "Overall": 778},
|
44 |
{"model_name": "gpt-4o", "url": "https://openai.com/index/hello-gpt-4o/", "organizer": "OpenAI", "license": "Proprietary", "MLE-Lite_Elo": 830, "Tabular_Elo": 861, "NLP_Elo": 903, "CV_Elo": 761, "Overall": 841},
|
@@ -60,11 +60,11 @@ COL_MAP = {
|
|
60 |
"CV": "CV_Elo",
|
61 |
}
|
62 |
|
63 |
-
#
|
64 |
-
# 2οΈβ£ Helper
|
65 |
-
#
|
66 |
|
67 |
-
def make_leaderboard(category: str) -> pd.DataFrame:
|
68 |
col = COL_MAP.get(category, "Overall")
|
69 |
df = (
|
70 |
master_df.loc[:, ["model_name", "url", "organizer", "license", col]]
|
@@ -76,10 +76,14 @@ def make_leaderboard(category: str) -> pd.DataFrame:
|
|
76 |
df["Model"] = df.apply(lambda r: f"<a href='{r.url}' target='_blank'>{r.Model}</a>", axis=1)
|
77 |
return df.drop(columns=["url"]).reset_index(drop=True)
|
78 |
|
79 |
-
#
|
80 |
# 3οΈβ£ Theme + CSS
|
81 |
-
#
|
82 |
-
THEME = gr.themes.Soft(
|
|
|
|
|
|
|
|
|
83 |
|
84 |
BASE_CSS = r"""
|
85 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
@@ -98,3 +102,21 @@ body { font-family:'Inter',system-ui,Arial,sans-serif; background:#f9fafb; colo
|
|
98 |
#leaderboard-table tr:nth-child(even) { background:#f9fafb; }
|
99 |
#leaderboard-table tr:hover { background:#ecfeff; }
|
100 |
#leaderboard-table td a { color:#2563eb; text-decoration:none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import pandas as pd
|
3 |
from apscheduler.schedulers.background import BackgroundScheduler
|
4 |
|
5 |
+
"""
|
6 |
+
MLEβDojo Leaderboard β polished Gradio app (v2.4)
|
7 |
+
-------------------------------------------------
|
8 |
+
Displays Elo scores of mainstream LLMs across MLEβDojo benchmark categories
|
9 |
+
with a clean, modern aesthetic.
|
10 |
+
"""
|
11 |
|
12 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
13 |
+
# 0οΈβ£ Safe imports (fallback to placeholders when src.* unavailable)
|
14 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
15 |
try:
|
16 |
from src.about import (
|
17 |
CITATION_BUTTON_LABEL,
|
|
|
22 |
)
|
23 |
from src.display.css_html_js import custom_css as EXTRA_CSS
|
24 |
from src.envs import REPO_ID
|
25 |
+
from src.submission.submit import add_new_eval
|
26 |
print("β Imported projectβlocal definitions from src.*")
|
27 |
except ImportError:
|
28 |
print("β src.* imports failed β using internal placeholders.")
|
|
|
36 |
def add_new_eval(*_):
|
37 |
return "Submission placeholder."
|
38 |
|
39 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
40 |
+
# 1οΈβ£ Static data (replace with live data source if desired)
|
41 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
42 |
MODELS = [
|
43 |
{"model_name": "gpt-4o-mini", "url": "https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/", "organizer": "OpenAI", "license": "Proprietary", "MLE-Lite_Elo": 753, "Tabular_Elo": 839, "NLP_Elo": 758, "CV_Elo": 754, "Overall": 778},
|
44 |
{"model_name": "gpt-4o", "url": "https://openai.com/index/hello-gpt-4o/", "organizer": "OpenAI", "license": "Proprietary", "MLE-Lite_Elo": 830, "Tabular_Elo": 861, "NLP_Elo": 903, "CV_Elo": 761, "Overall": 841},
|
|
|
60 |
"CV": "CV_Elo",
|
61 |
}
|
62 |
|
63 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
64 |
+
# 2οΈβ£ Helper to produce leaderboard DataFrame
|
65 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
66 |
|
67 |
+
def make_leaderboard(category: str = "Overall") -> pd.DataFrame:
|
68 |
col = COL_MAP.get(category, "Overall")
|
69 |
df = (
|
70 |
master_df.loc[:, ["model_name", "url", "organizer", "license", col]]
|
|
|
76 |
df["Model"] = df.apply(lambda r: f"<a href='{r.url}' target='_blank'>{r.Model}</a>", axis=1)
|
77 |
return df.drop(columns=["url"]).reset_index(drop=True)
|
78 |
|
79 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
80 |
# 3οΈβ£ Theme + CSS
|
81 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
82 |
+
THEME = gr.themes.Soft(
|
83 |
+
primary_hue="cyan",
|
84 |
+
neutral_hue="slate",
|
85 |
+
font=["Inter", "Helvetica", "Arial", "sans-serif"],
|
86 |
+
)
|
87 |
|
88 |
BASE_CSS = r"""
|
89 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
|
|
102 |
#leaderboard-table tr:nth-child(even) { background:#f9fafb; }
|
103 |
#leaderboard-table tr:hover { background:#ecfeff; }
|
104 |
#leaderboard-table td a { color:#2563eb; text-decoration:none; }
|
105 |
+
#leaderboard-table td a:hover { text-decoration:underline; }
|
106 |
+
.gr-accordion label { font-weight:600; }
|
107 |
+
.gr-button { font-weight:500; padding:.55em 1.4em; }
|
108 |
+
@media (max-width:480px){ .hero-title{font-size:2.4rem;} .subtitle{font-size:1.05rem;} }
|
109 |
+
"""
|
110 |
+
|
111 |
+
custom_css = EXTRA_CSS + BASE_CSS
|
112 |
+
|
113 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
114 |
+
# 4οΈβ£ Build Gradio UI
|
115 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
116 |
+
demo = gr.Blocks(css=custom_css, theme=THEME)
|
117 |
+
|
118 |
+
with demo:
|
119 |
+
# Hero section
|
120 |
+
gr.HTML(RAW_TITLE or (
|
121 |
+
"""
|
122 |
+
<h1 class='hero
|