Spaces:
Sleeping
Sleeping
shyuli commited on
Commit ·
2354057
1
Parent(s): a77c2f0
version v0.1
Browse filesFiles changed (10)
- .gradio/certificate.pemAdded+31
- README.mdDeleted-48
- app.py+97-112
- requirements.txtDeleted-16
- src/about.py+166-35
- src/display/formatting.py+22-2
- src/display/utils.py+11-13
- src/envs.py+1-1
- src/leaderboard/read_evals.py+33-33
- src/populate.py+4
12345678910111213141516171819202122232425262728293031-----BEGIN CERTIFICATE-----MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUvKBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWnOlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTnjh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbwqHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CIrU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkqhkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZLubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KKNFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7UrTkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdCjNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVcoyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPAmRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=-----END CERTIFICATE-----123456789101112131415161718192021222324252627282930313233343536373839404142434445464748---title: SearchAgent Leaderboardemoji: 🥇colorFrom: greencolorTo: indigosdk: gradioapp_file: app.pypinned: truelicense: apache-2.0short_description: Duplicate this leaderboard to initialize your own!sdk_version: 5.43.1tags:- leaderboard---
# Start the configuration
Most of the variables to change for a default leaderboard are in `src/env.py` (replace the path for your leaderboard) and `src/about.py` (for tasks).
Results files should have the following format and be stored as json files:```json{ "config": { "model_dtype": "torch.float16", # or torch.bfloat16 or 8bit or 4bit "model_name": "path of the model on the hub: org/model", "model_sha": "revision on the hub", }, "results": { "task_name": { "metric_name": score, }, "task_name2": { "metric_name": score, } }}```
Request files are created automatically by this tool.
If you encounter problem on the space, don't hesitate to restart it to remove the create eval-queue, eval-queue-bk, eval-results and eval-results-bk created folder.
# Code logic for more complex edits
You'll find - the main table' columns names and properties in `src/display/utils.py`- the logic to read all results and request files, then convert them in dataframe lines, in `src/leaderboard/read_evals.py`, and `src/populate.py`- the logic to allow or filter submissions in `src/submission/submit.py` and `src/submission/check_validity.py`2 unmodified lines34567813 unmodified lines222324252627283 unmodified lines3233343536373839404142434445464748495051524 unmodified lines5758596061625 unmodified lines6869707172737475767778798081828384858687883 unmodified lines92939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911928 unmodified lines2012022032042 unmodified linesimport pandas as pdfrom apscheduler.schedulers.background import BackgroundSchedulerfrom huggingface_hub import snapshot_downloadfrom src.about import (CITATION_BUTTON_LABEL,13 unmodified linesModelType,fields,WeightType,Precision)from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKENfrom src.populate import get_evaluation_queue_df, get_leaderboard_df3 unmodified linesdef restart_space():API.restart_space(repo_id=REPO_ID)### Space initialisationtry:print(EVAL_REQUESTS_PATH)snapshot_download(repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN)except Exception:restart_space()try:print(EVAL_RESULTS_PATH)snapshot_download(repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN)except Exception:restart_space()LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)4 unmodified linespending_eval_queue_df,) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)def init_leaderboard(dataframe):if dataframe is None or dataframe.empty:raise ValueError("Leaderboard DataFrame is empty or None.")5 unmodified linescant_deselect=[c.name for c in fields(AutoEvalColumn) if c.never_hidden],label="Select Columns to Display:",),search_columns=[AutoEvalColumn.model.name, AutoEvalColumn.license.name],hide_columns=[c.name for c in fields(AutoEvalColumn) if c.hidden],filter_columns=[ColumnFilter(AutoEvalColumn.model_type.name, type="checkboxgroup", label="Model types"),ColumnFilter(AutoEvalColumn.precision.name, type="checkboxgroup", label="Precision"),ColumnFilter(AutoEvalColumn.params.name,type="slider",min=0.01,max=150,label="Select the number of parameters (B)",),ColumnFilter(AutoEvalColumn.still_on_hub.name, type="boolean", label="Deleted/incomplete", default=True),],bool_checkboxgroup_label="Hide models",interactive=False,3 unmodified linesdemo = gr.Blocks(css=custom_css)with demo:gr.HTML(TITLE)gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")with gr.Tabs(elem_classes="tab-buttons") as tabs:with gr.TabItem("🏅 LLM Benchmark", elem_id="llm-benchmark-tab-table", id=0):leaderboard = init_leaderboard(LEADERBOARD_DF)with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")with gr.TabItem("🚀 Submit here! ", elem_id="llm-benchmark-tab-table", id=3):with gr.Column():with gr.Row():gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")with gr.Column():with gr.Accordion(f"✅ Finished Evaluations ({len(finished_eval_queue_df)})",open=False,):with gr.Row():finished_eval_table = gr.components.Dataframe(value=finished_eval_queue_df,headers=EVAL_COLS,datatype=EVAL_TYPES,row_count=5,)with gr.Accordion(f"🔄 Running Evaluation Queue ({len(running_eval_queue_df)})",open=False,):with gr.Row():running_eval_table = gr.components.Dataframe(value=running_eval_queue_df,headers=EVAL_COLS,datatype=EVAL_TYPES,row_count=5,)with gr.Accordion(f"⏳ Pending Evaluation Queue ({len(pending_eval_queue_df)})",open=False,):with gr.Row():pending_eval_table = gr.components.Dataframe(value=pending_eval_queue_df,headers=EVAL_COLS,datatype=EVAL_TYPES,row_count=5,)with gr.Row():gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")with gr.Row():with gr.Column():model_name_textbox = gr.Textbox(label="Model name")revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")model_type = gr.Dropdown(choices=[t.to_str(" : ") for t in ModelType if t != ModelType.Unknown],label="Model type",multiselect=False,value=None,interactive=True,)with gr.Column():precision = gr.Dropdown(choices=[i.value.name for i in Precision if i != Precision.Unknown],label="Precision",multiselect=False,value="float16",interactive=True,)weight_type = gr.Dropdown(choices=[i.value.name for i in WeightType],label="Weights type",multiselect=False,value="Original",interactive=True,)base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")submit_button = gr.Button("Submit Eval")submission_result = gr.Markdown()submit_button.click(add_new_eval,[model_name_textbox,base_model_name_textbox,revision_name_textbox,precision,weight_type,model_type,],submission_result,)with gr.Row():with gr.Accordion("📙 Citation", open=False):8 unmodified linesscheduler = BackgroundScheduler()scheduler.add_job(restart_space, "interval", seconds=1800)scheduler.start()demo.queue(default_concurrency_limit=40).launch()2 unmodified lines345678910111213 unmodified lines262728293031323 unmodified lines363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291304 unmodified lines1351361371381391401415 unmodified lines1471481491501511521531541551563 unmodified lines1601611621631641651661671681691701711721731741751761778 unmodified lines1861871881892 unmodified linesimport pandas as pdfrom apscheduler.schedulers.background import BackgroundSchedulerfrom huggingface_hub import snapshot_downloadimport jsonimport osimport datetimeimport urllib.parsefrom src.about import (CITATION_BUTTON_LABEL,13 unmodified linesModelType,fields,WeightType,Precision,)from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKENfrom src.populate import get_evaluation_queue_df, get_leaderboard_df3 unmodified linesdef restart_space():API.restart_space(repo_id=REPO_ID)def save_submission_and_notify(model_name, contact_email, weight_link, json_results, paper_link, description):"""Save submission to file and provide instructions for email"""try:# Validate JSON format if providedif json_results.strip():try:json.loads(json_results)except json.JSONDecodeError:return "❌ Invalid JSON format in results field"# Create submission datasubmission_data = {"timestamp": datetime.datetime.now().isoformat(),"model_name": model_name,"contact_email": contact_email,"weight_link": weight_link,"paper_link": paper_link,"description": description,"json_results": json_results,}# Save to submissions directoryos.makedirs("submissions", exist_ok=True)filename = (f"submissions/{model_name.replace('/', '_')}_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.json")with open(filename, "w") as f:json.dump(submission_data, f, indent=2)# Create mailto link for usersubject = f"SearchAgent Leaderboard Submission: {model_name}"body = f"""New model submission for SearchAgent Leaderboard:Model Name: {model_name}Contact Email: {contact_email}Weight Link: {weight_link}Paper Link: {paper_link}Description: {description}JSON Results:{json_results}"""# URL encode the email contentmailto_link = (f"mailto:shyuli@tencent.com?subject={urllib.parse.quote(subject)}&body={urllib.parse.quote(body[:500])}")return f"""✅ Submission saved successfully!📧 **Please send your submission to: shyuli@tencent.com**You can either:1. Click here to open your email client: [Send Email](mailto:shyuli@tencent.com)2. Or copy the submission details above and send manuallyYour submission has been saved to: {filename}We'll review your model and get back to you at {contact_email}."""except Exception as e:return f"❌ Failed to save submission: {str(e)}"### Space initialisation# Use local data for demo purposestry:print(EVAL_REQUESTS_PATH)# For demo, use local eval-queue directory if it existsimport osif not os.path.exists(EVAL_REQUESTS_PATH):os.makedirs(EVAL_REQUESTS_PATH, exist_ok=True)# snapshot_download(# repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN# )except Exception as e:print(f"Could not setup eval requests path: {e}")try:print(EVAL_RESULTS_PATH)# For demo, use local eval-results directory if it existsif not os.path.exists(EVAL_RESULTS_PATH):os.makedirs(EVAL_RESULTS_PATH, exist_ok=True)# snapshot_download(# repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN# )except Exception as e:print(f"Could not setup eval results path: {e}")LEADERBOARD_DF = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)4 unmodified linespending_eval_queue_df,) = get_evaluation_queue_df(EVAL_REQUESTS_PATH, EVAL_COLS)def init_leaderboard(dataframe):if dataframe is None or dataframe.empty:raise ValueError("Leaderboard DataFrame is empty or None.")5 unmodified linescant_deselect=[c.name for c in fields(AutoEvalColumn) if c.never_hidden],label="Select Columns to Display:",),search_columns=[AutoEvalColumn.model.name],hide_columns=[c.name for c in fields(AutoEvalColumn) if c.hidden],filter_columns=[ColumnFilter(AutoEvalColumn.model_size.name, type="checkboxgroup", label="Model Size"),],bool_checkboxgroup_label="Hide models",interactive=False,3 unmodified linesdemo = gr.Blocks(css=custom_css)with demo:gr.HTML(TITLE)with gr.Tabs(elem_classes="tab-buttons") as tabs:with gr.TabItem("🏅 SearchAgent Benchmark", elem_id="llm-benchmark-tab-table", id=0):leaderboard = init_leaderboard(LEADERBOARD_DF)gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=2):gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")with gr.TabItem("📤 Submit Model", elem_id="llm-benchmark-tab-table", id=3):with gr.Column():gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")with gr.Row():with gr.Accordion("📙 Citation", open=False):8 unmodified linesscheduler = BackgroundScheduler()scheduler.add_job(restart_space, "interval", seconds=1800)scheduler.start()demo.queue(default_concurrency_limit=40).launch(share=True)
12345678910111213141516APSchedulerblackdatasetsgradiogradio[oauth]gradio_leaderboard==0.0.13gradio_clienthuggingface-hub>=0.18.0matplotlibnumpypandaspython-dateutiltqdmtransformerstokenizers>=0.15.0sentencepiece1234564 unmodified lines1112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172from dataclasses import dataclassfrom enum import Enum@dataclassclass Task:benchmark: str4 unmodified lines# Select your tasks here# ---------------------------------------------------class Tasks(Enum):# task_key in the json file, metric_key in the json file, name to display in the leaderboardtask0 = Task("anli_r1", "acc", "ANLI")task1 = Task("logiqa", "acc_norm", "LogiQA")NUM_FEWSHOT = 0 # Change with your few shot# ---------------------------------------------------# Your leaderboard nameTITLE = """<h1 align="center" id="space-title">Demo leaderboard</h1>"""# What does your leaderboard evaluate?INTRODUCTION_TEXT = """Intro text"""# Which evaluations are you running? how can people reproduce what you have?LLM_BENCHMARKS_TEXT = f"""## How it works## ReproducibilityTo reproduce our results, here is the commands you can run:"""EVALUATION_QUEUE_TEXT = """## Some good practices before submitting a model### 1) Make sure you can load your model and tokenizer using AutoClasses:```pythonfrom transformers import AutoConfig, AutoModel, AutoTokenizerconfig = AutoConfig.from_pretrained("your model name", revision=revision)model = AutoModel.from_pretrained("your model name", revision=revision)tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)```If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.Note: make sure your model is public!Note: if your model needs `use_remote_code=True`, we do not support this option yet but we are working on adding it, stay posted!### 2) Convert your model weights to [safetensors](https://huggingface.co/docs/safetensors/index)It's a new format for storing weights which is safer and faster to load and use. It will also allow us to add the number of parameters of your model to the `Extended Viewer`!### 3) Make sure your model has an open license!This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗### 4) Fill up your model cardWhen we add extra information about models to the leaderboard, it will be automatically taken from the model card## In case of model failureIf your model is displayed in the `FAILED` category, its execution stopped.Make sure you have followed the above steps first.If everything is done, check you can launch the EleutherAIHarness on your model locally, using the above command without modifications (you can add `--limit` to limit the number of examples per task)."""CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"CITATION_BUTTON_TEXT = r""""""12345674 unmodified lines12131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203from dataclasses import dataclassfrom enum import Enum@dataclassclass Task:benchmark: str4 unmodified lines# Select your tasks here# ---------------------------------------------------class Tasks(Enum):# task_key in the json file, metric_key in the json file, name to display in the leaderboard# General QA tasksnq = Task("nq", "exact_match", "NQ")triviaqa = Task("triviaqa", "exact_match", "TriviaQA")popqa = Task("popqa", "exact_match", "PopQA")# Multi-hop QA taskshotpotqa = Task("hotpotqa", "exact_match", "HotpotQA")twowiki = Task("2wiki", "exact_match", "2wiki")musique = Task("musique", "exact_match", "Musique")bamboogle = Task("bamboogle", "exact_match", "Bamboogle")fictionalhot = Task("fictionalhot", "exact_match", "FictionalHot")NUM_FEWSHOT = 0 # Change with your few shot# ---------------------------------------------------# Your leaderboard nameTITLE = """<h1 align="center" id="space-title">🔍 SearchAgent Leaderboard</h1>"""# What does your leaderboard evaluate?INTRODUCTION_TEXT = """# 🔍 SearchAgent LeaderboardThis leaderboard evaluates the performance of **search-augmented question answering systems** across various tasks, ranging from simple factual QA to complex multi-hop reasoning. Our evaluation addresses the inconsistency in experimental settings across prior works by providing a standardized comparison framework.## 📊 Evaluation TasksWe evaluate on a comprehensive set of benchmarks that test different aspects of search-augmented QA:### General QA (Set A)- **NQ**: Natural Questions - QA based on real Google search queries from Wikipedia- **TriviaQA**: Trivia questions requiring document-based answer extraction- **PopQA**: Popular culture QA testing knowledge breadth and parametric vs. non-parametric memory### Multi-Hop QA (Set B)- **HotpotQA**: Complex QA requiring reasoning across multiple documents with explainable reasoning chains- **2wiki**: Multi-hop reasoning based on Wikipedia requiring compositional reasoning- **Musique**: Multi-step compositional reasoning QA via single-hop question composition- **Bamboogle**: Adversarial search QA designed to test compositionality gaps in language models### Novel Evaluation: FictionalHot- **FictionalHot**: A closed-world benchmark grounding questions in synthetic fictional entities to mitigate data contamination and enable reproducible evaluation. Questions are transformed from real-world scenarios to fictional ones while preserving reasoning structure.## 🎯 Evaluation MetricsFollowing standardized practices, we primarily use **Exact Match (EM)** as the main metric. A prediction is correct if its normalized string exactly matches any normalized reference answer (with lowercasing, punctuation removal, and whitespace normalization)."""# Which evaluations are you running? how can people reproduce what you have?LLM_BENCHMARKS_TEXT = f"""## 🔬 Evaluation MethodologyThis leaderboard addresses the challenge of inconsistent experimental settings in search agent evaluation by providing standardized comparisons. Prior works vary significantly in:1. **Corpora**: From static Wikipedia snapshots (2018, 2019) to live Internet access2. **Test Sets**: Broad evaluation (Set A) vs. focused multi-hop evaluation (Set B)3. **Training Regimes**: No training to multi-dataset fine-tuning approaches4. **Metrics**: Exact Match, F1, Substring matching, and LLM-as-a-judge evaluations## 📋 Dataset Details & Challenges### Data Contamination ProblemA critical issue in current benchmarks is **data contamination**, where high scores may reflect memorized pretraining knowledge rather than genuine procedural reasoning capabilities.### Our Solution: FictionalHotWe introduce **FictionalHot**, a novel closed-world benchmark that:- Grounds all questions in newly generated synthetic fictional entities- Uses a three-step construction pipeline: sampling → GPT-based entity replacement → synthetic document generation- Forces models to rely on procedural reasoning over provided documents- Enables reproducible evaluation with a fixed knowledge source### Benchmark Coverage- **Corpus**: 2018 Wikipedia snapshot for reproducibility- **Retrieval**: Top-k=3 with maximum T=4 tool-use turns per question## 🔄 Experimental SetupFollowing established practices, we:- Fine-tune on unified NQ + HotpotQA training data- Evaluate on Qwen2.5-3B-Instruct and Qwen2.5-7B-Instruct models- Use E5 embeddings for retrieval backend- Apply standard Exact Match evaluation with string normalization"""EVALUATION_QUEUE_TEXT = """## 📣 Model Submission via CommunityWe now accept submissions via the Space's Community (Discussions). This keeps the process simple and transparent.- Go to the Community tab of this leaderboard Space:https://huggingface.co/spaces/TencentBAC/SearchAgent_Leaderboard- Create a new Discussion with title:`Submission: <YourMethod>-<model_name>-<model_size>`- Include the following in the post:- Model weights link (HF or GitHub)- Short method description- Evaluation JSON (inline or attached)Example JSON:```json{"config": {"model_dtype": "torch.float16","model_name": "YourMethod-Qwen2.5-7b-Instruct","model_sha": "main"},"results": {"nq": {"exact_match": 0.45},"triviaqa": {"exact_match": 0.62},"popqa": {"exact_match": 0.38},"hotpotqa": {"exact_match": 0.41},"2wiki": {"exact_match": 0.33},"musique": {"exact_match": 0.15},"bamboogle": {"exact_match": 0.28},"fictionalhot": {"exact_match": 0.06}}}```We will review your post and add your model to the leaderboard."""CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"CITATION_BUTTON_TEXT = r"""% Key Search-Augmented QA Methods@article{luo2024search,title={Search-o1: Agentic Search-Enhanced Large Reasoning Models},author={Xiaoxi Li and Guanting Dong and Jiajie Jin and Yuyao Zhang and Yujia Zhou and Yutao Zhu and Peitian Zhang and Zhicheng Dou},journal={arXiv preprint arXiv:2501.05366},year={2025}}@article{songR1SearcherIncentivizingSearch2025,title={R1-Searcher: Incentivizing the Search Capability in LLMs via Reinforcement Learning},author={Song, Huatong and Jiang, Jinhao and Min, Yingqian and Chen, Jie and Chen, Zhipeng and Zhao, Wayne Xin and Fang, Lei and Wen, Ji-Rong},journal={arXiv preprint arXiv:2503.05592},year={2025}}@article{jin2025search,title={Search-r1: Training llms to reason and leverage search engines with reinforcement learning},author={Jin, Bowen and Zeng, Hansi and Yue, Zhenrui and Yoon, Jinsung and Arik, Sercan and Wang, Dong and Zamani, Hamed and Han, Jiawei},journal={arXiv preprint arXiv:2503.09516},year={2025}}@article{sunZeroSearchIncentivizeSearch2025,title={ZeroSearch: Incentivize the Search Capability of LLMs without Searching},author={Sun, Hao and Qiao, Zile and Guo, Jiayan and Fan, Xuanbo and Hou, Yingyan and Jiang, Yong and Xie, Pengjun and Zhang, Yan and Huang, Fei and Zhou, Jingren},journal={arXiv preprint arXiv:2505.04588},year={2025}}@article{zheng2025deepresearcher,title={Deepresearcher: Scaling deep research via reinforcement learning in real-world environments},author={Zheng, Yuxiang and Fu, Dayuan and Hu, Xiangkun and Cai, Xiaojie and Ye, Lyumanshan and Lu, Pengrui and Liu, Pengfei},journal={arXiv preprint arXiv:2504.03160},year={2025}}% Benchmark Datasets@article{kwiatkowskiNaturalQuestionsBenchmark2019,title={Natural Questions: A Benchmark for Question Answering Research},author={Kwiatkowski, Tom and Palomaki, Jennimaria and Redfield, Olivia and Collins, Michael and Parikh, Ankur and Alberti, Chris and Epstein, Danielle and Polosukhin, Illia and Devlin, Jacob and Lee, Kenton and others},journal={Transactions of the Association for Computational Linguistics},volume={7},pages={453--466},year={2019}}@article{yangHotpotQADatasetDiverse2018,title={HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering},author={Yang, Zhilin and Qi, Peng and Zhang, Saizheng and Bengio, Yoshua and Cohen, William and Salakhutdinov, Ruslan and Manning, Christopher D.},booktitle={Proceedings of EMNLP},year={2018}}@article{trivediMuSiQueMultihopQuestions2022,title={MuSiQue: Multihop Questions via Single-hop Question Composition},author={Trivedi, Harsh and Balasubramanian, Niranjan and Khot, Tushar and Sabharwal, Ashish},journal={Transactions of the Association for Computational Linguistics},volume={10},pages={539--554},year={2022}}"""
2 unmodified lines3456789102 unmodified linesdef make_clickable_model(model_name):link = f"https://huggingface.co/{model_name}"return model_hyperlink(link, model_name)def styled_error(error):2 unmodified lines34567891011121314151617181920212223242526272829302 unmodified linesdef make_clickable_model(model_name):# Custom link mappings for each modelcustom_links = {"ReSeek-Qwen2.5-7b-Instruct": "https://your-custom-link.com/reseek-7b","ReSeek-Qwen2.5-3b-Instruct": "https://your-custom-link.com/reseek-3b","ZeroSearch-Qwen2.5-3b-Instruct": "https://huggingface.co/Alibaba-NLP/ZeroSearch_wiki_V2_Qwen2.5_3B_Instruct","ZeroSearch-Qwen2.5-7b-Instruct": "https://huggingface.co/Alibaba-NLP/ZeroSearch_wiki_V2_Qwen2.5_7B_Instruct","Search-R1-Qwen2.5-7b-Instruct": "https://huggingface.co/PeterJinGo/SearchR1-nq_hotpotqa_train-qwen2.5-7b-it-em-ppo","Search-R1-Qwen2.5-3b-Instruct": "https://huggingface.co/PeterJinGo/SearchR1-nq_hotpotqa_train-qwen2.5-3b-em-grpo","Search-o1-Qwen2.5-7b-Instruct": "https://github.com/RUC-NLPIR/Search-o1","RAG-Qwen2.5-7b-Instruct": "","R1-Qwen2.5-7b-Instruct": "","SFT-Qwen2.5-7b-Instruct": "","CoT-Qwen2.5-7b-Instruct": "","Direct-Inference-Qwen2.5-7b-Instruct": "",}if model_name in custom_links:link = custom_links[model_name]return model_hyperlink(link, model_name)else:# If no custom link, just return the model namereturn model_namedef styled_error(error):
4 unmodified lines56789109 unmodified lines20212223242526272829303132333435363738394041424344454647484 unmodified lines53545556575859606162636418 unmodified lines83848586878889909192936 unmodified lines1001011021031041051 unmodified line1071081091104 unmodified linesfrom src.about import Tasksdef fields(raw_class):return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]9 unmodified lineshidden: bool = Falsenever_hidden: bool = False## Leaderboard columnsauto_eval_column_dict = []# Initauto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])#Scoresauto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])for task in Tasks:auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])# Model informationauto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str", False)])auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])auto_eval_column_dict.append(["license", ColumnContent, ColumnContent("Hub License", "str", False)])auto_eval_column_dict.append(["params", ColumnContent, ColumnContent("#Params (B)", "number", False)])auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️", "number", False)])auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Available on the hub", "bool", False)])auto_eval_column_dict.append(["revision", ColumnContent, ColumnContent("Model sha", "str", False, False)])# We use make dataclass to dynamically fill the scores from TasksAutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)## For the queue columns in the submission tab@dataclass(frozen=True)class EvalQueueColumn: # Queue column4 unmodified linesweight_type = ColumnContent("weight_type", "str", "Original")status = ColumnContent("status", "str", True)## All the model information that we might need@dataclassclass ModelDetails:name: strdisplay_name: str = ""symbol: str = "" # emojiclass ModelType(Enum):18 unmodified linesreturn ModelType.IFTreturn ModelType.Unknownclass WeightType(Enum):Adapter = ModelDetails("Adapter")Original = ModelDetails("Original")Delta = ModelDetails("Delta")class Precision(Enum):float16 = ModelDetails("float16")bfloat16 = ModelDetails("bfloat16")6 unmodified linesreturn Precision.bfloat16return Precision.Unknown# Column selectionCOLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]1 unmodified lineEVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]BENCHMARK_COLS = [t.value.col_name for t in Tasks]4 unmodified lines5678910119 unmodified lines21222324252627282930313233343536373839404142434 unmodified lines4849505152535455565758596018 unmodified lines798081828384858687888990916 unmodified lines98991001011021031041 unmodified line1061071084 unmodified linesfrom src.about import Tasksdef fields(raw_class):return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]9 unmodified lineshidden: bool = Falsenever_hidden: bool = False## Leaderboard columnsauto_eval_column_dict = []# Initauto_eval_column_dict.append(["rank", ColumnContent, ColumnContent("Rank", "number", True, never_hidden=True)])auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])# Scoresauto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])for task in Tasks:auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])# Model informationauto_eval_column_dict.append(["model_size", ColumnContent, ColumnContent("Model Size", "str", True)])# We use make dataclass to dynamically fill the scores from TasksAutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict, frozen=True)## For the queue columns in the submission tab@dataclass(frozen=True)class EvalQueueColumn: # Queue column4 unmodified linesweight_type = ColumnContent("weight_type", "str", "Original")status = ColumnContent("status", "str", True)## All the model information that we might need@dataclassclass ModelDetails:name: strdisplay_name: str = ""symbol: str = "" # emojiclass ModelType(Enum):18 unmodified linesreturn ModelType.IFTreturn ModelType.Unknownclass WeightType(Enum):Adapter = ModelDetails("Adapter")Original = ModelDetails("Original")Delta = ModelDetails("Delta")class Precision(Enum):float16 = ModelDetails("float16")bfloat16 = ModelDetails("bfloat16")6 unmodified linesreturn Precision.bfloat16return Precision.Unknown# Column selectionCOLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]1 unmodified lineEVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]BENCHMARK_COLS = [t.value.col_name for t in Tasks]
5 unmodified lines67891011125 unmodified lines# ----------------------------------TOKEN = os.environ.get("HF_TOKEN") # A read/write token for your orgOWNER = "demo-leaderboard-backend" # Change to your org - don't forget to create a results and request dataset, with the correct format!# ----------------------------------REPO_ID = f"{OWNER}/leaderboard"5 unmodified lines67891011125 unmodified lines# ----------------------------------TOKEN = os.environ.get("HF_TOKEN") # A read/write token for your orgOWNER = "searchagent-leaderboard" # Change to your org - don't forget to create a results and request dataset, with the correct format!# ----------------------------------REPO_ID = f"{OWNER}/leaderboard"
13 unmodified lines1415161718192021222324252627282930313233343521 unmodified lines57585960616263646519 unmodified lines8586878889909192939414 unmodified lines10911011111211311411511611711811912012112212312412512612712812913013113213312 unmodified lines14614714814915015115215315415532 unmodified lines18818919019119219319413 unmodified lines@dataclassclass EvalResult:"""Represents one full evaluation. Built from a combination of the result and request file for a given run."""eval_name: str # org_model_precision (uid)full_model: str # org/model (path on hub)org: strmodel: strrevision: str # commit hash, "" if mainresults: dictprecision: Precision = Precision.Unknownmodel_type: ModelType = ModelType.Unknown # Pretrained, fine tuned, ...weight_type: WeightType = WeightType.Original # Original or Adapterarchitecture: str = "Unknown"license: str = "?"likes: int = 0num_params: int = 0date: str = "" # submission date of request filestill_on_hub: bool = False@classmethod21 unmodified linesresult_key = f"{org}_{model}_{precision.value.name}"full_model = "/".join(org_and_model)still_on_hub, _, model_config = is_model_on_hub(full_model, config.get("model_sha", "main"), trust_remote_code=True, test_tokenizer=False)architecture = "?"if model_config is not None:architectures = getattr(model_config, "architectures", None)19 unmodified linesorg=org,model=model,results=results,precision=precision,revision= config.get("model_sha", ""),still_on_hub=still_on_hub,architecture=architecture)def update_with_request_file(self, requests_path):14 unmodified linesdef to_dict(self):"""Converts the Eval Result to a dict compatible with our dataframe display"""average = sum([v for v in self.results.values() if v is not None]) / len(Tasks)data_dict = {"eval_name": self.eval_name, # not a column, just a save name,AutoEvalColumn.precision.name: self.precision.value.name,AutoEvalColumn.model_type.name: self.model_type.value.name,AutoEvalColumn.model_type_symbol.name: self.model_type.value.symbol,AutoEvalColumn.weight_type.name: self.weight_type.value.name,AutoEvalColumn.architecture.name: self.architecture,AutoEvalColumn.model.name: make_clickable_model(self.full_model),AutoEvalColumn.revision.name: self.revision,AutoEvalColumn.average.name: average,AutoEvalColumn.license.name: self.license,AutoEvalColumn.likes.name: self.likes,AutoEvalColumn.params.name: self.num_params,AutoEvalColumn.still_on_hub.name: self.still_on_hub,}for task in Tasks:data_dict[task.value.col_name] = self.results[task.value.benchmark]return data_dict12 unmodified linesfor tmp_request_file in request_files:with open(tmp_request_file, "r") as f:req_content = json.load(f)if (req_content["status"] in ["FINISHED"]and req_content["precision"] == precision.split(".")[-1]):request_file = tmp_request_filereturn request_file32 unmodified linesresults = []for v in eval_results.values():try:v.to_dict() # we test if the dict version is completeresults.append(v)except KeyError: # not all eval values presentcontinue13 unmodified lines1415161718192021222324252627282930313233343521 unmodified lines57585960616263646566676819 unmodified lines8889909192939495969714 unmodified lines11211311411511611711811912012112212312412512612712812913013113213313413513612 unmodified lines14915015115215315415532 unmodified lines18818919019119219319413 unmodified lines@dataclassclass EvalResult:"""Represents one full evaluation. Built from a combination of the result and request file for a given run."""eval_name: str # org_model_precision (uid)full_model: str # org/model (path on hub)org: strmodel: strrevision: str # commit hash, "" if mainresults: dictprecision: Precision = Precision.Unknownmodel_type: ModelType = ModelType.Unknown # Pretrained, fine tuned, ...weight_type: WeightType = WeightType.Original # Original or Adapterarchitecture: str = "Unknown"license: str = "?"likes: int = 0num_params: int = 0date: str = "" # submission date of request filestill_on_hub: bool = False@classmethod21 unmodified linesresult_key = f"{org}_{model}_{precision.value.name}"full_model = "/".join(org_and_model)# For demo purposes, assume models are availablestill_on_hub = Truemodel_config = None# still_on_hub, _, model_config = is_model_on_hub(# full_model, config.get("model_sha", "main"), trust_remote_code=True, test_tokenizer=False# )architecture = "?"if model_config is not None:architectures = getattr(model_config, "architectures", None)19 unmodified linesorg=org,model=model,results=results,precision=precision,revision=config.get("model_sha", ""),still_on_hub=still_on_hub,architecture=architecture,)def update_with_request_file(self, requests_path):14 unmodified linesdef to_dict(self):"""Converts the Eval Result to a dict compatible with our dataframe display"""valid_results = [v for v in self.results.values() if v is not None]average = sum(valid_results) / len(valid_results) if valid_results else 0# Extract model size from model namemodel_size = "Unknown"if "3b" in self.full_model.lower():model_size = "3B"elif "7b" in self.full_model.lower():model_size = "7B"data_dict = {"eval_name": self.eval_name, # not a column, just a save name,AutoEvalColumn.rank.name: 0, # Will be set later based on average rankingAutoEvalColumn.model.name: make_clickable_model(self.full_model),AutoEvalColumn.model_size.name: model_size,AutoEvalColumn.average.name: average,}for task in Tasks:data_dict[task.value.col_name] = self.results.get(task.value.benchmark, None)return data_dict12 unmodified linesfor tmp_request_file in request_files:with open(tmp_request_file, "r") as f:req_content = json.load(f)if req_content["status"] in ["FINISHED"] and req_content["precision"] == precision.split(".")[-1]:request_file = tmp_request_filereturn request_file32 unmodified linesresults = []for v in eval_results.values():try:v.to_dict() # we test if the dict version is completeresults.append(v)except KeyError: # not all eval values presentcontinue
14 unmodified lines15161718192014 unmodified linesdf = pd.DataFrame.from_records(all_data_json)df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)df = df[cols].round(decimals=2)# filter out if any of the benchmarks have not been produced14 unmodified lines1516171819202122232414 unmodified linesdf = pd.DataFrame.from_records(all_data_json)df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)# Add ranking based on average scoredf[AutoEvalColumn.rank.name] = range(1, len(df) + 1)df = df[cols].round(decimals=2)# filter out if any of the benchmarks have not been produced
.gradio/certificate.pemAdded+31
README.mdDeleted-48
app.py+97-112
requirements.txtDeleted-16
src/about.py+166-35
src/display/formatting.py+22-2
src/display/utils.py+11-13
src/envs.py+1-1
src/leaderboard/read_evals.py+33-33
src/populate.py+4