TRL documentation

安装

You are viewing v1.18.0 version. A newer version v1.18.1 is available.
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