CoolFace
Datasetpublic

cabbage972/GitChameleon-2.0

GitChameleon 2.0 GitChameleon 2.0 is an AI coding benchmark comprising 328 Python-based problems conditioned on specific versions of popular libraries for scientific computing and web development. It evaluates whether AI code generation models can correctly use library APIs as they existed at a particular version — a challenging test of version-specific knowledge. Note: This is GitChameleon 2.0, a distinct and newer work from the original GitChameleon benchmark. Please do not… See the full description on the dataset page: https://huggingface.co/datasets/cabbage972/GitChameleon-2.0.

sourceHugging Facemitupdated 5mo agoView on Hugging Face
2likes194downloads
Dataset Card

GitChameleon 2.0

GitChameleon 2.0 is an AI coding benchmark comprising 328 Python-based problems conditioned on specific versions of popular libraries for scientific computing and web development. It evaluates whether AI code generation models can correctly use library APIs as they existed at a particular version — a challenging test of version-specific knowledge.

Note: This is GitChameleon 2.0, a distinct and newer work from the original GitChameleon benchmark. Please do not confuse the two.

Project website: gitchameleon-2-0.github.io — paper, results, citation, and getting started guide.

Paper: GitChameleon 2.0: Evaluating AI Code Generation Against Python Library Version Incompatibilities (ACL 2026, Main)

Example Task

Each problem provides a library version, a natural-language description, and a stub to complete:

Library: torch==1.9.0 | Python: 3.7 Problem: Calculate the logarithm of the cumulative distribution function of the standard normal distribution using available functions. If not available in PyTorch, use another library.
python
import torch
def log_ndtr(input_tensor: torch.Tensor) -> torch.Tensor:
    # your solution here

The model must produce a solution that passes the visible test:

python
from scipy.stats import norm
input_tensor = torch.linspace(-10, 10, steps=20)
expected_result = torch.tensor([-5.3231e+01, ..., -7.6199e-24], dtype=torch.float64)
assert torch.allclose(log_ndtr(input_tensor), expected_result, rtol=1e-3, atol=1e-3)

This particular problem tests awareness that torch.special.log_ndtr was not available in torch==1.9.0, requiring the model to fall back to scipy.stats.norm.logcdf.

Dataset Configs

ConfigDescriptionRows
problemsProblem statements, starting code, solutions, and metadata328
solutionsGround-truth solutions keyed by example_id328

Usage

python
from datasets import load_dataset

# Load problems
ds = load_dataset("cabbage972/GitChameleon-2.0", "problems")

# Load ground-truth solutions
solutions = load_dataset("cabbage972/GitChameleon-2.0", "solutions")

Schema

problems config

FieldTypeDescription
example_idstringUnique identifier (0–327)
librarystringTarget Python library (e.g. torch, scipy, flask)
versionstringLibrary version the problem is conditioned on
python_versionstringRequired Python version (3.7, 3.9, or 3.10)
problemstringNatural-language task description
starting_codestringStub function/class definition to complete
solutionstringReference solution
teststringVisible pytest assertions
functionalint1 if the library is a scientific/functional library
webdevint1 if the library is a web-development library
solution_api_callboolWhether the solution uses an API call
api_callslist[string]API calls used in the reference solution
type_of_changestringCategory of version change (e.g. argument change, name change)
name_of_class_or_funcstringName of the target function or class
additional_dependenciesstringExtra packages required (e.g. scipy==1.7.3)
extra_dependenciesstringAdditional optional dependencies (nullable)
release_datestringLibrary release date (YYYY-MM)
docslist[string]Relevant documentation URLs

solutions config

FieldTypeDescription
example_idstringMatches example_id in problems
answerstringComplete function/class implementation

Running Evaluation

Evaluation is run via the GitChameleonBenchmark harness. Requirements: Python 3.9+, Poetry, and Docker.

bash
git clone https://github.com/mrcabbage972/GitChameleonBenchmark.git
cd GitChameleonBenchmark
make evals-setup
evaluate --solution-path SOLUTION_PATH [--workers WORKERS]

Your solution file should be a JSONL where each line has example_id and answer fields (matching the solutions config schema above). Success rates are printed to stdout and detailed logs are written next to the solution file.

Libraries Covered

26 libraries including: torch, scipy, sympy, flask, falcon, numpy, scikit-learn, pandas, django, librosa, and more.

Citation

bibtex
@misc{misra2025gitchameleon20evaluatingai,
      title={GitChameleon 2.0: Evaluating AI Code Generation Against Python Library Version Incompatibilities},
      author={Diganta Misra and Nizar Islah and Victor May and Brice Rauby and Zihan Wang and Justine Gehring and Antonio Orvieto and Muawiz Chaudhary and Eilif B. Muller and Irina Rish and Samira Ebrahimi Kahou and Massimo Caccia},
      year={2025},
      eprint={2507.12367},
      archivePrefix={arXiv},
      primaryClass={cs.SE},
      url={https://arxiv.org/abs/2507.12367},
}