Spaces:
Sleeping
Sleeping
Update miniapp_leaderboard.py
Browse files- miniapp_leaderboard.py +4 -31
miniapp_leaderboard.py
CHANGED
|
@@ -9,7 +9,7 @@ import gradio as gr
|
|
| 9 |
import pandas as pd
|
| 10 |
from huggingface_hub import HfApi, hf_hub_download
|
| 11 |
|
| 12 |
-
APP_NAME = "
|
| 13 |
|
| 14 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 15 |
LEADERBOARD_DATASET = os.environ.get("LEADERBOARD_DATASET", "").strip()
|
|
@@ -136,55 +136,28 @@ def submit(model_name, model_family, email, zip_file):
|
|
| 136 |
|
| 137 |
|
| 138 |
with gr.Blocks(title=f"{APP_NAME} leaderboard") as demo:
|
| 139 |
-
|
| 140 |
gr.Markdown(f"# {APP_NAME} Leaderboard")
|
| 141 |
|
| 142 |
-
#
|
| 143 |
-
# Leaderboard 说明(占位符)
|
| 144 |
-
# ===============================
|
| 145 |
-
gr.Markdown(
|
| 146 |
-
"""
|
| 147 |
-
## Leaderboard Description
|
| 148 |
-
|
| 149 |
-
_Placeholder text: describe your benchmark, evaluation protocol,
|
| 150 |
-
scoring methodology, and ranking rules here._
|
| 151 |
-
"""
|
| 152 |
-
)
|
| 153 |
-
|
| 154 |
-
# 排行榜(占满横向)
|
| 155 |
leaderboard = gr.Dataframe(
|
| 156 |
value=_load_df(APPROVED_PREFIX),
|
| 157 |
interactive=False,
|
| 158 |
wrap=True,
|
| 159 |
-
|
| 160 |
)
|
| 161 |
|
| 162 |
refresh_btn = gr.Button("Refresh")
|
| 163 |
|
| 164 |
-
#
|
| 165 |
-
# Submission 区域
|
| 166 |
-
# ===============================
|
| 167 |
-
gr.Markdown("---")
|
| 168 |
-
|
| 169 |
-
gr.Markdown(
|
| 170 |
-
"""
|
| 171 |
-
## Submission Instructions
|
| 172 |
-
|
| 173 |
-
_Placeholder text: explain submission format, evaluation pipeline,
|
| 174 |
-
review policy, and contact information here._
|
| 175 |
-
"""
|
| 176 |
-
)
|
| 177 |
|
| 178 |
model_name = gr.Textbox(label="Model name")
|
| 179 |
model_family = gr.Textbox(label="Model family")
|
| 180 |
email = gr.Textbox(label="Email")
|
| 181 |
zip_file = gr.File(label="Upload zip", file_types=[".zip"])
|
| 182 |
-
|
| 183 |
submit_btn = gr.Button("Submit", variant="primary")
|
| 184 |
status = gr.Markdown()
|
| 185 |
|
| 186 |
refresh_btn.click(refresh, outputs=[leaderboard])
|
| 187 |
-
|
| 188 |
submit_btn.click(
|
| 189 |
submit,
|
| 190 |
inputs=[model_name, model_family, email, zip_file],
|
|
|
|
| 9 |
import pandas as pd
|
| 10 |
from huggingface_hub import HfApi, hf_hub_download
|
| 11 |
|
| 12 |
+
APP_NAME = "miniapp"
|
| 13 |
|
| 14 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 15 |
LEADERBOARD_DATASET = os.environ.get("LEADERBOARD_DATASET", "").strip()
|
|
|
|
| 136 |
|
| 137 |
|
| 138 |
with gr.Blocks(title=f"{APP_NAME} leaderboard") as demo:
|
|
|
|
| 139 |
gr.Markdown(f"# {APP_NAME} Leaderboard")
|
| 140 |
|
| 141 |
+
# ✅ 占满横向宽度
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
leaderboard = gr.Dataframe(
|
| 143 |
value=_load_df(APPROVED_PREFIX),
|
| 144 |
interactive=False,
|
| 145 |
wrap=True,
|
| 146 |
+
elem_classes="full-width",
|
| 147 |
)
|
| 148 |
|
| 149 |
refresh_btn = gr.Button("Refresh")
|
| 150 |
|
| 151 |
+
gr.Markdown("## Submit")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
model_name = gr.Textbox(label="Model name")
|
| 154 |
model_family = gr.Textbox(label="Model family")
|
| 155 |
email = gr.Textbox(label="Email")
|
| 156 |
zip_file = gr.File(label="Upload zip", file_types=[".zip"])
|
|
|
|
| 157 |
submit_btn = gr.Button("Submit", variant="primary")
|
| 158 |
status = gr.Markdown()
|
| 159 |
|
| 160 |
refresh_btn.click(refresh, outputs=[leaderboard])
|
|
|
|
| 161 |
submit_btn.click(
|
| 162 |
submit,
|
| 163 |
inputs=[model_name, model_family, email, zip_file],
|