tpc-vote / app.py
huckiyang's picture
Upload app.py with huggingface_hub
75c7d46 verified
Raw
History Blame Contribute Delete
5.57 kB
import os
import re
import json
import datetime
import gradio as gr
from huggingface_hub import HfApi
# --- Configuration ---------------------------------------------------------
DATASET_REPO = "huckiyang/tpc-vote-results" # private dataset, one JSON per reviewer
REVIEWERS = [
"Ziyang Ma",
"Ruiyang Xu",
"Yinghao Ma",
"Huck Yang",
"Bohan Li",
"Jaeyeon Kim",
"Jin Xu",
"Jinyu Li",
"Carlos Busso",
"Kai Yu",
"Eng Siong Chng",
"Xie Chen",
]
# Paper ID β€” title (titles extracted from the submission PDFs).
PAPERS = [
"118 β€” The Interspeech 2026 Audio Reasoning Challenge: Evaluating Reasoning Process Quality for Audio Reasoning Models and Agents",
"491 β€” TinyGiantALM: A Compact Audio-Language Model for Intent-Aware Reasoning under Resource Constraints",
"637 β€” TAD: Token-Adaptive Contrastive Decoding with Confidence-Guided Gating for Hallucination Mitigation in Large Audio-Language Models",
"988 β€” Audio-Cogito: Towards Deep Audio Reasoning in Large Audio Language Models",
"1212 β€” MATA: A Training-Free Approach to Mitigate Cross-Modal Attention Imbalance in Large Audio Language Models",
"1313 β€” EChO-Agent: Evidence Chain Orchestration Agent for Audio Reasoning",
"1720 β€” Audio-DeepThinker: Progressive Reasoning-Aware Reinforcement Learning for High-Quality Chain-of-Thought Emergence in Audio Language Models ⭐",
"2273 β€” Beyond Symmetric Interaction: Capability-Aware Asymmetric Multi-Agent Collaboration for Audio Deep Reasoning",
"2381 β€” VISA: A Visual Information Strengthened Audio-Reasoning System for the Interspeech 2026 ARC Agent Track ⭐",
"2880 β€” Structured Prompting vs. Self-Training for Audio Reasoning Under Limited Data and Compute: Lessons from Interspeech Audio Reasoning Challenge 2026",
"3297 β€” Multi-Source Evidence Fusion for Audio Question Answering ⭐",
]
# Secrets (set in HF Space β†’ Settings β†’ Secrets)
PASSCODE = os.environ.get("VOTE_PASSCODE", "")
# Each paper's Figure 1 thumbnail, bundled in the Space (loaded locally, no API).
PAPER_IMG = {p: f"assets/{p.split(' β€” ')[0]}.png" for p in PAPERS}
# Optional reviewer notes, keyed by paper ID.
NOTES = {
"1720": "⭐ Avg. rating **5** β€” 1st in Single Model Track",
"2381": "⭐ Avg. rating **5** β€” 2nd in Agent Track",
"3297": "⭐ Rating **4.3** β€” 1st in Agent Track",
}
api = HfApi() # reads HF_TOKEN from the environment
def show_fig(choice):
if not choice:
return None, ""
return PAPER_IMG.get(choice), NOTES.get(choice.split(" β€” ")[0], "")
def _slug(name):
return re.sub(r"[^a-z0-9]+", "-", name.lower()).strip("-")
# --- Submission handler ----------------------------------------------------
def submit(name, passcode, top, second, third, email):
if PASSCODE and passcode.strip() != PASSCODE:
return "❌ Incorrect passcode."
if not name:
return "❌ Please select your name."
picks = [top, second, third]
if any(not p for p in picks):
return "❌ Please choose a paper for all three ranks."
if len(set(picks)) != 3:
return "❌ Your three picks must be three different papers."
if not email or "@" not in email or "." not in email.split("@")[-1]:
return "❌ Please enter a valid email address."
record = {
"name": name,
"top": top, # 3 points
"second": second, # 2 points
"third": third, # 1 point
"email": email,
"timestamp": datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M UTC"),
}
try:
api.upload_file(
path_or_fileobj=json.dumps(record, indent=2).encode(),
path_in_repo=f"votes/{_slug(name)}.json",
repo_id=DATASET_REPO,
repo_type="dataset",
commit_message=f"vote: {name}",
)
except Exception as e: # surface the real error to the voter
return f"⚠️ Could not save your vote: {e}"
return (f"βœ… Recorded for **{name}** β€” "
f"1st: {top} (3), 2nd: {second} (2), 3rd: {third} (1).\n\n"
f"You can re-submit any time before the deadline to change your vote.")
# --- UI --------------------------------------------------------------------
with gr.Blocks(title="TPC Best Paper Vote") as demo:
gr.Markdown(
"## πŸ—³οΈ TPC Best Paper Vote\n"
"Pick **three different** papers. 1st place = 3 points, "
"2nd = 2, 3rd = 1. Re-submitting overwrites your previous vote."
)
name = gr.Dropdown(REVIEWERS, label="Your name")
passcode = gr.Textbox(label="Passcode", type="password",
placeholder="from the invitation email")
top = gr.Dropdown(PAPERS, label="1st place (3 points)")
top_img = gr.Image(label="Figure", height=200)
top_note = gr.Markdown()
second = gr.Dropdown(PAPERS, label="2nd place (2 points)")
second_img = gr.Image(label="Figure", height=200)
second_note = gr.Markdown()
third = gr.Dropdown(PAPERS, label="3rd place (1 point)")
third_img = gr.Image(label="Figure", height=200)
third_note = gr.Markdown()
email = gr.Textbox(label="Your email")
btn = gr.Button("Submit vote", variant="primary")
out = gr.Markdown()
top.change(show_fig, top, [top_img, top_note])
second.change(show_fig, second, [second_img, second_note])
third.change(show_fig, third, [third_img, third_note])
btn.click(submit, [name, passcode, top, second, third, email], out)
if __name__ == "__main__":
demo.launch()