Skip to content

Latest commit

 

History

History
142 lines (100 loc) · 3.47 KB

dependencies.md

File metadata and controls

142 lines (100 loc) · 3.47 KB

dependencies

在启动服务之前,请确保已安装以下依赖项。

1. Python 和 Git

Python 3.10 和 Git 安装方法:

  • Windows:

    • 下载并运行 Python 3.10 的安装程序: 网页, exe 或 win7 版本。
    • 下载并运行 Git 的安装程序: 网页
  • Linux (基于 Debian 的发行版):

    sudo apt install wget git python3 python3-venv
  • Linux (基于 Red Hat 的发行版):

    sudo dnf install wget git python3
  • Linux (基于 Arch 的发行版):

    sudo pacman -S wget git python3

2. 下载仓库代码

执行以下命令将本仓库代码克隆到本地:

git clone https://github.com/lenML/ChatTTS-Forge.git --depth=1

3. 模型文件

  • 自行下载(任选其一):

  • 使用脚本下载(任选其一):

    • 从 HuggingFace 下载:
      python -m scripts.download_models --source huggingface
    • 从 ModelScope 下载:
      python -m scripts.download_models --source modelscope

安装完成之后 models 文件夹应该如下

./models
├── ChatTTS
│   ├── asset
│   │   ├── DVAE.pt
│   │   ├── Decoder.pt
│   │   ├── GPT.pt
│   │   ├── Vocos.pt
│   │   ├── spk_stat.pt
│   │   └── tokenizer.pt
│   └── config
│       ├── decoder.yaml
│       ├── dvae.yaml
│       ├── gpt.yaml
│       ├── path.yaml
│       └── vocos.yaml
├── put_model_here
└── resemble-enhance
    ├── hparams.yaml
    └── mp_rank_00_model_states.pt

4. 后处理工具链

音频后处理操作(如加速、减速、提高音量等)依赖以下库:

  • ffmpeglibav(推荐使用 ffmpeg)
  • rubberband-cli(仅 Linux 环境需要)

安装 ffmpeg

Mac(使用 Homebrew:

brew install ffmpeg

Linux(使用 aptitude):

apt-get install ffmpeg libavcodec-extra
apt-get install rubberband-cli

Windows:

若你已经安装有 ffmpeg,并可以在命令行中调用,那么无需进行下面的下载和安装

  1. 此处下载并解压 ffmpeg 的 Windows 二进制文件。
  2. 将 ffmpeg 的/bin文件夹中的 .exe 文件解压到 项目目录/ffmpeg 文件夹内

文件 (window) 目录应该如下

./ffmpeg
├── ffmpeg.exe
├── ffprobe.exe
├── ffplay.exe
└── put_ffmpeg_here

5. 安装 python 依赖

pytorch

由于 pytroch 安装与你的本机环境有关,请自行安装对应版本,下面是一个简单的安装脚本

(如果直接运行某些情况可能会安装 cpu 版本,具体应该指定什么版本请自行确定)

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 -f https://mirror.sjtu.edu.cn/pytorch-wheels/torch_stable.html

其余依赖

python -m pip install -r requirements.txt

6. 其他

如果需要部署 Docker 环境,请配置 Docker 和 Docker Compose。