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 lines345678910111213 unmodified lines26272825293031323 unmodified lines36373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112383940414211311411511611711811912012112245464748491231241251261271281291304 unmodified lines1351361371381391401415 unmodified lines147148149711501511527475767778798081828384851531541551563 unmodified lines16016116295163164981651661671681691701711041721731061071741081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891751761778 unmodified lines1861871882041892 unmodified linesimport pandas as pdfrom apscheduler.schedulers.background import BackgroundSchedulerfrom huggingface_hub import snapshot_downloadimport jsonimport osimport datetimeimport urllib.parse
from src.about import ( CITATION_BUTTON_LABEL,13 unmodified lines ModelType, fields, WeightType, Precision 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 provided if json_results.strip(): try: json.loads(json_results) except json.JSONDecodeError: return "❌ Invalid JSON format in results field"
# Create submission data submission_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 directory os.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 user subject = 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 content mailto_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 manually
Your 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 exists import os
if 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: restart_space() # 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 exists if 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: restart_space() # 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 lines pending_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 lines cant_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], search_columns=[AutoEvalColumn.model.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 ), 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) 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): 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 here! ", elem_id="llm-benchmark-tab-table", id=3): with gr.TabItem("📤 Submit Model", elem_id="llm-benchmark-tab-table", id=3): with gr.Column(): with gr.Row(): gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text") 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()demo.queue(default_concurrency_limit=40).launch(share=True)12345678910111213141516APSchedulerblackdatasetsgradiogradio[oauth]gradio_leaderboard==0.0.13gradio_clienthuggingface-hub>=0.18.0matplotlibnumpypandaspython-dateutiltqdmtransformerstokenizers>=0.15.0sentencepiece12345674 unmodified lines121314141516171815161718192021222324252627282930312232243334353628373839404142434445464748495051525354555657585960616263646533666735366869387071727374404142434445464748495075767778798081828384858652538788899055569192585993949596979861629964656667100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203from 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 task0 = Task("anli_r1", "acc", "ANLI") task1 = Task("logiqa", "acc_norm", "LogiQA")
NUM_FEWSHOT = 0 # Change with your few shot # task_key in the json file, metric_key in the json file, name to display in the leaderboard # General QA tasks nq = Task("nq", "exact_match", "NQ") triviaqa = Task("triviaqa", "exact_match", "TriviaQA") popqa = Task("popqa", "exact_match", "PopQA") # Multi-hop QA tasks hotpotqa = 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">Demo leaderboard</h1>"""TITLE = """<h1 align="center" id="space-title">🔍 SearchAgent Leaderboard</h1>"""
# What does your leaderboard evaluate?INTRODUCTION_TEXT = """Intro text# 🔍 SearchAgent Leaderboard
This 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 Tasks
We 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"""## How it works## 🔬 Evaluation Methodology
## ReproducibilityTo reproduce our results, here is the commands you can run:This 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
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.## 📋 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
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!### Benchmark Coverage- **Corpus**: 2018 Wikipedia snapshot for reproducibility- **Retrieval**: Top-k=3 with maximum T=4 tool-use turns per question
### 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`!## 🔄 Experimental Setup
### 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 🤗Following 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
### 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)."""
EVALUATION_QUEUE_TEXT = """## 📣 Model Submission via Community
We 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 lines3456789101112131415161718192021226723242526272829302 unmodified lines
def make_clickable_model(model_name): # Custom link mappings for each model custom_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 = f"https://huggingface.co/{model_name}" return model_hyperlink(link, model_name) link = custom_links[model_name] return model_hyperlink(link, model_name) else: # If no custom link, just return the model name return model_name
def styled_error(error):4 unmodified lines5678910119 unmodified lines212223242526272628292830313233343334353637383940413536373839404142434 unmodified lines484950515253545556615758596018 unmodified lines798081828384858687888990916 unmodified lines98991001011021031041 unmodified line1061071081104 unmodified lines
from src.about import Tasks
def fields(raw_class): return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
9 unmodified lines hidden: bool = False never_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(["rank", ColumnContent, ColumnContent("Rank", "number", True, never_hidden=True)])auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])#Scores# 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)])auto_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 lines weight_type = ColumnContent("weight_type", "str", "Original") status = ColumnContent("status", "str", True)
## All the model information that we might need@dataclassclass ModelDetails: name: str display_name: str = "" symbol: str = "" # emoji symbol: str = "" # emoji
class ModelType(Enum):18 unmodified lines return ModelType.IFT return ModelType.Unknown
class WeightType(Enum): Adapter = ModelDetails("Adapter") Original = ModelDetails("Original") Delta = ModelDetails("Delta")
class Precision(Enum): float16 = ModelDetails("float16") bfloat16 = ModelDetails("bfloat16")6 unmodified lines return Precision.bfloat16 return 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 lines678991011125 unmodified lines# ----------------------------------TOKEN = os.environ.get("HF_TOKEN") # A read/write token for your org
OWNER = "demo-leaderboard-backend" # Change to your org - don't forget to create a results and request dataset, with the correct format!OWNER = "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 lines141516171819202117181920212223232425262728262728293031323233343521 unmodified lines57585960616260616263646566676819 unmodified lines8889908889919293919495969714 unmodified lines11211311411211511611711811912012112212312412511511611711811912612712112812912312412512613013113213013313413513612 unmodified lines14915015114915015115215215315415532 unmodified lines18818919019119119219319413 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: str """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: str model: str revision: str # commit hash, "" if main revision: str # commit hash, "" if main results: dict precision: Precision = Precision.Unknown model_type: ModelType = ModelType.Unknown # Pretrained, fine tuned, ... weight_type: WeightType = WeightType.Original # Original or Adapter architecture: str = "Unknown" model_type: ModelType = ModelType.Unknown # Pretrained, fine tuned, ... weight_type: WeightType = WeightType.Original # Original or Adapter architecture: str = "Unknown" license: str = "?" likes: int = 0 num_params: int = 0 date: str = "" # submission date of request file date: str = "" # submission date of request file still_on_hub: bool = False
@classmethod21 unmodified lines result_key = f"{org}_{model}_{precision.value.name}" full_model = "/".join(org_and_model)
# For demo purposes, assume models are available still_on_hub = True model_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 ) # 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 lines org=org, model=model, results=results, precision=precision, revision= config.get("model_sha", ""), precision=precision, revision=config.get("model_sha", ""), still_on_hub=still_on_hub, architecture=architecture architecture=architecture, )
def update_with_request_file(self, requests_path):14 unmodified lines
def 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) 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 name model_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.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.rank.name: 0, # Will be set later based on average ranking AutoEvalColumn.model.name: make_clickable_model(self.full_model), AutoEvalColumn.revision.name: self.revision, AutoEvalColumn.model_size.name: model_size, 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] data_dict[task.value.col_name] = self.results.get(task.value.benchmark, None)
return data_dict
12 unmodified lines for 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] ): if req_content["status"] in ["FINISHED"] and req_content["precision"] == precision.split(".")[-1]: request_file = tmp_request_file return request_file
32 unmodified lines results = [] for v in eval_results.values(): try: v.to_dict() # we test if the dict version is complete v.to_dict() # we test if the dict version is complete results.append(v) except KeyError: # not all eval values present continue14 unmodified lines1516171819202122232414 unmodified lines
df = pd.DataFrame.from_records(all_data_json) df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
# Add ranking based on average score df[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