目录

安装说明

先决条件:torchtune 需要 PyTorch,因此请根据您的主机和环境进行安装 使用 Start Local (本地启动) 页面。

通过 PyPI 安装

torchtune 的最新稳定版本托管在 PyPI 上,可以下载 使用以下命令:

pip install torchtune

要确认软件包安装正确,您可以运行以下命令:

tune

并且应该看到以下输出:

usage: tune [-h] {download,ls,cp,run,validate} ...

Welcome to the torchtune CLI!

options:
-h, --help            show this help message and exit

...

安装方式git clone

如果您想从 torchtune 获得最新和最强大的功能,或者如果您想成为贡献者, 您还可以使用以下命令在本地安装软件包。

git clone https://github.com/pytorch/torchtune.git
cd torchtune
pip install -e .

安装 nightly build

Torchtune 每天晚上都会使用对 Branch 的最新提交进行构建。如果您需要最新的更新 到包中,而不通过 进行安装,您可以使用以下命令进行安装:maingit clone

pip install --pre torchtune --extra-index-url https://download.pytorch.org/whl/nightly/cpu --no-cache-dir

注意

--no-cache-dir将直接不查找 torchtune 的缓存版本,从而覆盖 您现有的 Torchtune 安装。pip

如果您已经安装了 PyTorch,则 torchtune 将默认使用该版本。但是,如果您想 使用 nightly 版本的 PyTorch,您可以将选项附加到上述命令中。如果你 选择此安装方法,您可能需要更改索引 URL 中的“cpu”后缀以匹配您的 CUDA 版本。例如,如果您运行的是 CUDA 12,则索引 URL 将为 “https://download.pytorch.org/whl/nightly/cu121”。--force-reinstall

文档

访问 PyTorch 的全面开发人员文档

查看文档

教程

获取面向初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并解答您的问题

查看资源