Spaces:
Running
Running
Update miniapp_leaderboard.py
Browse files- miniapp_leaderboard.py +19 -18
miniapp_leaderboard.py
CHANGED
|
@@ -160,33 +160,38 @@ def submit(model_name, model_family, zip_file, profile: gr.OAuthProfile):
|
|
| 160 |
return "Submitted. Waiting for review.", refresh()
|
| 161 |
|
| 162 |
|
| 163 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
gr.Markdown(f"# {APP_NAME} Leaderboard")
|
| 165 |
|
| 166 |
leaderboard = gr.Dataframe(value=_load_df(APPROVED_PREFIX), interactive=False, wrap=True)
|
| 167 |
refresh_btn = gr.Button("Refresh")
|
| 168 |
|
| 169 |
-
|
| 170 |
gr.Markdown("## Submit")
|
| 171 |
|
| 172 |
gr.Markdown(
|
| 173 |
"""
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
)
|
| 183 |
-
|
| 184 |
model_name = gr.Textbox(label="Model name", placeholder="e.g. MyModel v1")
|
| 185 |
model_family = gr.Textbox(label="Model family", placeholder="e.g. Llama / Qwen / InternLM ...")
|
| 186 |
zip_file = gr.File(label="Upload zip (.zip only)", file_types=[".zip"])
|
| 187 |
|
| 188 |
-
|
| 189 |
-
# ✅ 同一行:左登录,右提交
|
| 190 |
with gr.Row():
|
| 191 |
with gr.Column(scale=1, min_width=220):
|
| 192 |
login_btn = gr.LoginButton()
|
|
@@ -195,10 +200,6 @@ with gr.Blocks(title=f"{APP_NAME} leaderboard") as demo:
|
|
| 195 |
|
| 196 |
status = gr.Markdown()
|
| 197 |
|
| 198 |
-
submit_btn.click(
|
| 199 |
-
submit,
|
| 200 |
-
inputs=[model_name, model_family, zip_file],
|
| 201 |
-
outputs=[status, leaderboard],
|
| 202 |
-
)
|
| 203 |
|
| 204 |
demo.launch()
|
|
|
|
| 160 |
return "Submitted. Waiting for review.", refresh()
|
| 161 |
|
| 162 |
|
| 163 |
+
with gr.Blocks(
|
| 164 |
+
title=f"{APP_NAME} leaderboard",
|
| 165 |
+
css="""
|
| 166 |
+
.gradio-container { font-size: 18px; }
|
| 167 |
+
/* 表格字号单独再加一层,确保生效 */
|
| 168 |
+
.gradio-container table { font-size: 18px; }
|
| 169 |
+
"""
|
| 170 |
+
) as demo:
|
| 171 |
+
|
| 172 |
gr.Markdown(f"# {APP_NAME} Leaderboard")
|
| 173 |
|
| 174 |
leaderboard = gr.Dataframe(value=_load_df(APPROVED_PREFIX), interactive=False, wrap=True)
|
| 175 |
refresh_btn = gr.Button("Refresh")
|
| 176 |
|
|
|
|
| 177 |
gr.Markdown("## Submit")
|
| 178 |
|
| 179 |
gr.Markdown(
|
| 180 |
"""
|
| 181 |
+
**Submission requirements**
|
| 182 |
+
- Please **sign in with Hugging Face** before submitting.
|
| 183 |
+
- **One submission per user per day** (UTC).
|
| 184 |
+
- Upload a **.zip** file only.
|
| 185 |
+
- The `.zip` must contain the HTML outputs for the **test set queries**.
|
| 186 |
+
- Each file should be named using the query index: `<index>.html` (e.g., `1.html`, `2.html`, ...).
|
| 187 |
+
- After you submit, we will update the result in 3 days.
|
| 188 |
+
""",
|
| 189 |
)
|
| 190 |
+
|
| 191 |
model_name = gr.Textbox(label="Model name", placeholder="e.g. MyModel v1")
|
| 192 |
model_family = gr.Textbox(label="Model family", placeholder="e.g. Llama / Qwen / InternLM ...")
|
| 193 |
zip_file = gr.File(label="Upload zip (.zip only)", file_types=[".zip"])
|
| 194 |
|
|
|
|
|
|
|
| 195 |
with gr.Row():
|
| 196 |
with gr.Column(scale=1, min_width=220):
|
| 197 |
login_btn = gr.LoginButton()
|
|
|
|
| 200 |
|
| 201 |
status = gr.Markdown()
|
| 202 |
|
| 203 |
+
submit_btn.click(submit, inputs=[model_name, model_family, zip_file], outputs=[status, leaderboard])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
|
| 205 |
demo.launch()
|