GPT-SoVITS是一个强大的少样本语音转换和语音合成 WebUI 工具,输入 5 秒的声音样本就能体验文本到语音转换。支持少样本 TTS、英语、日语和中文,集成了声音伴奏分离、中文自动语音识别和文本标注等功能。
主要特性
-
零样本TTS(文本到语音转换):输入一个5秒的语音样本,即可立即体验文本到语音的转换。
-
少样本TTS:仅需1分钟训练数据即可对模型进行微调,以提高语音相似度和逼真度。
-
跨语言支持:支持不同于训练数据集的语言进行推理,目前支持英语、日语和中文。
-
WebUI工具:集成的工具包括语音伴奏分离、自动训练集分割、中文语音识别(ASR)和文本标注,帮助初学者创建训练数据集和GPT/SoVITS模型。
开始使用 🚀
中国地区用户, 可以 点击这里 使用 AutoDL Cloud Docker在线部署.
测试环境
- Python 3.9, PyTorch 2.0.1, CUDA 11
- Python 3.10.13, PyTorch 2.1.2, CUDA 12.3
- Python 3.9, PyTorch 2.2.2, macOS 14.4.1 (Apple silicon)
- Python 3.9, PyTorch 2.2.2, CPU devices
Note: numba==0.56.4 requires py<3.11
Windows
Windows用户 (已测试 win>=10), 可以 下载安装包 后 双击 go-webui.bat 启动 GPT-SoVITS-WebUI.
国内用户可以在 这里下载安装包 点击连接后选择 “下载” (如果出现错误可以注销.)
Linux
conda create -n GPTSoVits python=3.9
conda activate GPTSoVits
bash install.sh
macOS
注意: 与在其他设备上训练的模型相比,在Mac上用GPU训练的模型质量要低得多,因此我们暂时使用CPU.
- 命令行安装Xcode
xcode-select --install
. - 安装 FFmpeg
brew install ffmpeg
. - 安装GPTSoVits:
conda create -n GPTSoVits python=3.9
conda activate GPTSoVits
pip install -r requirements.txt
手动安装
安装依赖
pip install -r requirements.txt
安装 FFmpeg
Conda 用户
conda install ffmpeg
Ubuntu/Debian 用户
sudo apt install ffmpeg
sudo apt install libsox-dev
conda install -c conda-forge 'ffmpeg<7'
Windows 用户
下载 ffmpeg.exe and ffprobe.exe in the GPT-SoVITS root.
MacOS 用户
brew install ffmpeg
使用 Docker
docker-compose.yaml 配置
- Regarding image tags: Due to rapid updates in the codebase and the slow process of packaging and testing images, please check Docker Hub for the currently packaged latest images and select as per your situation, or alternatively, build locally using a Dockerfile according to your own needs.
- Environment Variables:
- is_half: Controls half-precision/double-precision. This is typically the cause if the content under the directories 4-cnhubert/5-wav32k is not generated correctly during the “SSL extracting” step. Adjust to True or False based on your actual situation.
- Volumes Configuration,The application’s root directory inside the container is set to /workspace. The default docker-compose.yaml lists some practical examples for uploading/downloading content.
- shm_size: The default available memory for Docker Desktop on Windows is too small, which can cause abnormal operations. Adjust according to your own situation.
- Under the deploy section, GPU-related settings should be adjusted cautiously according to your system and actual circumstances.
运行 docker compose
docker compose -f "docker-compose.yaml" up -d
运行 docker command
如上所述,根据您的实际情况修改相应的参数,然后运行以下命令:
docker run --rm -it --gpus=all --env=is_half=False --volume=G:\GPT-SoVITS-DockerTest\output:/workspace/output --volume=G:\GPT-SoVITS-DockerTest\logs:/workspace/logs --volume=G:\GPT-SoVITS-DockerTest\SoVITS_weights:/workspace/SoVITS_weights --workdir=/workspace -p 9880:9880 -p 9871:9871 -p 9872:9872 -p 9873:9873 -p 9874:9874 --shm-size="16G" -d breakstring/gpt-sovits:xxxxx