mirror of
https://github.com/huggingface/trl.git
synced 2025-10-20 10:03:51 +08:00
169 lines
3.5 KiB
TOML
169 lines
3.5 KiB
TOML
[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.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13"
|
|
]
|
|
requires-python = ">=3.9"
|
|
dependencies = [
|
|
"accelerate>=1.4.0",
|
|
"datasets>=3.0.0",
|
|
"transformers>=4.56.1",
|
|
"transformers!=4.57.0; python_version == '3.9'"
|
|
]
|
|
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"
|
|
]
|
|
judges = [
|
|
"openai>=1.23.2",
|
|
"llm-blender>=0.0.2"
|
|
]
|
|
liger = [
|
|
"liger-kernel>=0.6.2"
|
|
]
|
|
peft = [
|
|
"peft>=0.8.0"
|
|
]
|
|
quality = [
|
|
"pre-commit",
|
|
"hf-doc-builder"
|
|
]
|
|
quantization = [
|
|
"bitsandbytes"
|
|
]
|
|
scikit = [
|
|
"scikit-learn"
|
|
]
|
|
test = [
|
|
"parameterized",
|
|
"pytest-cov",
|
|
"pytest-rerunfailures==15.1",
|
|
"pytest-xdist",
|
|
"pytest"
|
|
]
|
|
vllm = [
|
|
"vllm==0.10.2",
|
|
"fastapi",
|
|
"pydantic",
|
|
"requests",
|
|
"uvicorn"
|
|
]
|
|
vlm = [
|
|
"Pillow",
|
|
"torchvision",
|
|
"num2words==0.5.14"
|
|
]
|
|
math_verify = [
|
|
"math-verify>=0.5.2",
|
|
]
|
|
dev = [
|
|
# bco
|
|
"scikit-learn",
|
|
"joblib",
|
|
# deepspeed
|
|
"deepspeed>=0.14.4",
|
|
# judges
|
|
"openai>=1.23.2",
|
|
"llm-blender>=0.0.2",
|
|
# liger
|
|
"liger-kernel>=0.6.2",
|
|
# peft
|
|
"peft>=0.8.0",
|
|
# quality
|
|
"pre-commit",
|
|
"hf-doc-builder",
|
|
# quantization
|
|
"bitsandbytes",
|
|
# scikit: included in bco
|
|
# test
|
|
"parameterized",
|
|
"pytest-cov",
|
|
"pytest-rerunfailures==15.1",
|
|
"pytest-xdist",
|
|
"pytest",
|
|
# vllm: not included in dev by default due to CUDA error; see GH-4228
|
|
# vlm
|
|
"Pillow",
|
|
"torchvision",
|
|
"num2words==0.5.14"
|
|
]
|
|
|
|
[tool.setuptools]
|
|
package-dir = {"trl" = "trl"}
|
|
|
|
[tool.setuptools.dynamic]
|
|
version = { file = "VERSION" }
|
|
|
|
[tool.coverage.run]
|
|
branch = true
|
|
|
|
[tool.ruff]
|
|
target-version = "py39"
|
|
line-length = 119
|
|
src = ["trl"]
|
|
|
|
[tool.ruff.lint]
|
|
ignore = [
|
|
"B028", # warning without explicit stacklevel
|
|
"C408", # dict() calls (stylistic)
|
|
"C901", # function complexity
|
|
"E501",
|
|
]
|
|
extend-select = ["E", "F", "I", "W", "UP", "B", "T", "C"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# Allow prints in auxiliary scripts
|
|
"examples/**.py" = ["T201"]
|
|
"scripts/**.py" = ["T201"]
|
|
# Ignore import violations in all `__init__.py` files.
|
|
"__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\"')"
|
|
]
|
|
addopts = [
|
|
"-k", "not experimental",
|
|
]
|