| [build-system]
|
| requires = ["setuptools >= 77.0.3"]
|
| build-backend = "setuptools.build_meta"
|
|
|
| [project]
|
| name = "trl"
|
| description = "Train transformer language models with reinforcement learning."
|
| authors = [
|
| { name = "Leandro von Werra", email = "leandro.vonwerra@gmail.com" }
|
| ]
|
| readme = { file = "README.md", content-type = "text/markdown" }
|
| license = "Apache-2.0"
|
| license-files = ["LICENSE"]
|
| keywords = [
|
| "transformers", "huggingface", "language modeling", "post-training", "rlhf", "sft", "dpo", "grpo"
|
| ]
|
| classifiers = [
|
| "Development Status :: 2 - Pre-Alpha",
|
| "Intended Audience :: Developers",
|
| "Intended Audience :: Science/Research",
|
| "Natural Language :: English",
|
| "Operating System :: OS Independent",
|
| "Programming Language :: Python :: 3",
|
| "Programming Language :: Python :: 3.10",
|
| "Programming Language :: Python :: 3.11",
|
| "Programming Language :: Python :: 3.12",
|
| "Programming Language :: Python :: 3.13",
|
| "Programming Language :: Python :: 3.14"
|
| ]
|
| requires-python = ">=3.10"
|
| dependencies = [
|
| "accelerate>=1.4.0",
|
| "datasets>=4.7.0",
|
| "jinja2",
|
| "packaging>20.0",
|
| "transformers>=4.56.2",
|
| ]
|
| dynamic = ["version"]
|
|
|
| [project.urls]
|
| Homepage = "https://github.com/huggingface/trl"
|
|
|
| [project.scripts]
|
| trl = "trl.cli:main"
|
|
|
| [project.optional-dependencies]
|
| bco = [
|
| "scikit-learn",
|
| "joblib"
|
| ]
|
| deepspeed = [
|
| "deepspeed>=0.14.4",
|
| "transformers!=5.1.0",
|
| ]
|
| kernels = [
|
| "kernels"
|
| ]
|
| liger = [
|
| "liger-kernel>=0.7.0"
|
| ]
|
| peft = [
|
| "peft>=0.8.0"
|
| ]
|
| quality = [
|
| "pre-commit",
|
| "hf-doc-builder"
|
| ]
|
| quantization = [
|
| "bitsandbytes"
|
| ]
|
| scikit = [
|
| "scikit-learn"
|
| ]
|
| test = [
|
| "pytest-cov",
|
| "pytest-datadir>=1.7.0",
|
| "pytest-rerunfailures==15.1",
|
| "pytest-xdist",
|
| "pytest"
|
| ]
|
| vllm = [
|
| "vllm>=0.12.0,<=0.18.0",
|
| "fastapi",
|
| "pydantic",
|
| "aiohttp>=3.13.3",
|
| "requests",
|
| "uvicorn"
|
| ]
|
| vlm = [
|
| "Pillow",
|
| "torchvision",
|
| "num2words==0.5.14"
|
| ]
|
| math_verify = [
|
| "math-verify>=0.5.2",
|
| ]
|
| dev = [
|
|
|
| "scikit-learn",
|
| "joblib",
|
|
|
| "deepspeed>=0.14.4",
|
|
|
| "kernels",
|
|
|
| "liger-kernel>=0.7.0",
|
|
|
| "peft>=0.8.0",
|
|
|
| "pre-commit",
|
| "hf-doc-builder",
|
|
|
| "bitsandbytes",
|
|
|
|
|
| "pytest-cov",
|
| "pytest-datadir>=1.7.0",
|
| "pytest-rerunfailures==15.1",
|
| "pytest-xdist",
|
| "pytest",
|
|
|
|
|
| "Pillow",
|
| "torchvision",
|
| "num2words==0.5.14",
|
|
|
| "jmespath",
|
| ]
|
|
|
| [tool.setuptools]
|
| package-dir = {"trl" = "trl"}
|
|
|
| [tool.setuptools.dynamic]
|
| version = { file = "VERSION" }
|
|
|
| [tool.coverage.run]
|
| branch = true
|
|
|
| [tool.ruff]
|
| target-version = "py310"
|
| line-length = 119
|
| src = ["trl"]
|
|
|
| [tool.ruff.lint]
|
| ignore = [
|
| "B028",
|
| "C408",
|
| "C901",
|
| "E501",
|
| ]
|
| extend-select = ["E", "F", "I", "W", "UP", "B", "T", "C"]
|
|
|
| [tool.ruff.lint.per-file-ignores]
|
|
|
| "examples/**.py" = ["T201"]
|
| "scripts/**.py" = ["T201"]
|
| "trl/cli/**.py" = ["T201"]
|
| "trl/skills/cli.py" = ["T201"]
|
|
|
| "__init__.py" = ["F401"]
|
|
|
| [tool.ruff.lint.isort]
|
| lines-after-imports = 2
|
| known-first-party = ["trl"]
|
|
|
| [tool.pytest.ini_options]
|
| markers = [
|
| "slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
| "low_priority: marks tests as low priority (deselect with '-m \"not low_priority\"')"
|
| ]
|
| norecursedirs = [
|
| "tests/experimental",
|
| ]
|
| filterwarnings = [
|
|
|
|
|
| "ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning",
|
| "ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning",
|
| "ignore:builtin type swigvarlink has no __module__ attribute:DeprecationWarning",
|
|
|
|
|
|
|
|
|
|
|
| "ignore:`torch.jit.script_method` is deprecated:DeprecationWarning",
|
| "ignore:`torch.jit.script` is deprecated:DeprecationWarning",
|
|
|
|
|
|
|
|
|
| "ignore:The argument 'device' of Tensor.pin_memory:DeprecationWarning",
|
| "ignore:The argument 'device' of Tensor.is_pinned:DeprecationWarning",
|
| ]
|
|
|