MedGRPO Team commited on
Commit ·
0b84800
1
Parent(s): 4c12bb6
add model links
Browse files
app.py
CHANGED
|
@@ -1244,7 +1244,7 @@ def parse_evaluation_output(output: str) -> Dict[str, float]:
|
|
| 1244 |
return metrics
|
| 1245 |
|
| 1246 |
|
| 1247 |
-
def submit_model(file, model_name: str, organization: str, contact: str = "", progress=gr.Progress()):
|
| 1248 |
"""
|
| 1249 |
Process model submission: validate, evaluate, and add to leaderboard.
|
| 1250 |
Yields progress updates during evaluation.
|
|
@@ -1437,12 +1437,18 @@ def submit_model(file, model_name: str, organization: str, contact: str = "", pr
|
|
| 1437 |
progress(0.90, desc="Adding to leaderboard...")
|
| 1438 |
yield "📊 **Step 5/6**: Adding model to leaderboard..."
|
| 1439 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1440 |
new_entry = {
|
| 1441 |
"model_name": model_name,
|
| 1442 |
"organization": organization,
|
| 1443 |
**{metric: round(metrics.get(metric, 0.0), 3) for metric in METRICS.keys()},
|
| 1444 |
"date": datetime.now().strftime("%Y-%m-%d"),
|
| 1445 |
-
"contact": contact
|
|
|
|
|
|
|
| 1446 |
}
|
| 1447 |
|
| 1448 |
df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True)
|
|
@@ -2226,6 +2232,12 @@ with gr.Blocks(title="MedVidBench Leaderboard", theme=gr.themes.Soft()) as demo:
|
|
| 2226 |
info="For follow-up questions"
|
| 2227 |
)
|
| 2228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2229 |
with gr.Column():
|
| 2230 |
results_file_input = gr.File(
|
| 2231 |
label="Upload Results JSON",
|
|
@@ -2240,7 +2252,7 @@ with gr.Blocks(title="MedVidBench Leaderboard", theme=gr.themes.Soft()) as demo:
|
|
| 2240 |
# Wire up submission with progress tracking
|
| 2241 |
submit_btn.click(
|
| 2242 |
fn=submit_model,
|
| 2243 |
-
inputs=[results_file_input, model_name_input, org_input, contact_input],
|
| 2244 |
outputs=submission_output
|
| 2245 |
)
|
| 2246 |
|
|
|
|
| 1244 |
return metrics
|
| 1245 |
|
| 1246 |
|
| 1247 |
+
def submit_model(file, model_name: str, organization: str, contact: str = "", model_url: str = "", progress=gr.Progress()):
|
| 1248 |
"""
|
| 1249 |
Process model submission: validate, evaluate, and add to leaderboard.
|
| 1250 |
Yields progress updates during evaluation.
|
|
|
|
| 1437 |
progress(0.90, desc="Adding to leaderboard...")
|
| 1438 |
yield "📊 **Step 5/6**: Adding model to leaderboard..."
|
| 1439 |
|
| 1440 |
+
clean_url = (model_url or "").strip()
|
| 1441 |
+
if clean_url and not (clean_url.startswith("http://") or clean_url.startswith("https://")):
|
| 1442 |
+
clean_url = ""
|
| 1443 |
+
|
| 1444 |
new_entry = {
|
| 1445 |
"model_name": model_name,
|
| 1446 |
"organization": organization,
|
| 1447 |
**{metric: round(metrics.get(metric, 0.0), 3) for metric in METRICS.keys()},
|
| 1448 |
"date": datetime.now().strftime("%Y-%m-%d"),
|
| 1449 |
+
"contact": contact,
|
| 1450 |
+
"model_url": clean_url,
|
| 1451 |
+
"status": "self_reported",
|
| 1452 |
}
|
| 1453 |
|
| 1454 |
df = pd.concat([df, pd.DataFrame([new_entry])], ignore_index=True)
|
|
|
|
| 2232 |
info="For follow-up questions"
|
| 2233 |
)
|
| 2234 |
|
| 2235 |
+
model_url_input = gr.Textbox(
|
| 2236 |
+
label="Model URL (Optional)",
|
| 2237 |
+
placeholder="https://huggingface.co/your-org/your-model",
|
| 2238 |
+
info="Link to model card, paper, or project page — your model name becomes a clickable link"
|
| 2239 |
+
)
|
| 2240 |
+
|
| 2241 |
with gr.Column():
|
| 2242 |
results_file_input = gr.File(
|
| 2243 |
label="Upload Results JSON",
|
|
|
|
| 2252 |
# Wire up submission with progress tracking
|
| 2253 |
submit_btn.click(
|
| 2254 |
fn=submit_model,
|
| 2255 |
+
inputs=[results_file_input, model_name_input, org_input, contact_input, model_url_input],
|
| 2256 |
outputs=submission_output
|
| 2257 |
)
|
| 2258 |
|