TRL documentation

安装

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.18.0).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

安装

您可以从 PyPI 或从源代码安装 TRL:

PyPI

使用 pip 或 uv 安装该库:

uv
pip

uv 是一个基于 Rust 的快速 Python 包和项目管理器。有关安装说明,请参阅 安装。

uv pip install trl

源代码

您也可以从源代码安装最新版本。首先克隆仓库,然后使用 pip 运行安装:

git clone https://github.com/huggingface/trl.git
cd trl/
pip install -e .

如果您想要开发安装,可以用以下内容替换 pip install:

pip install -e ".[dev]"
Update on GitHub