Files
storyteller-ml/tts/GPT-SoVITS
2024-07-16 17:14:11 +05:30
..
2024-07-12 07:27:18 +05:30
2024-07-16 17:10:28 +05:30
2024-07-12 07:27:18 +05:30
2024-07-16 17:10:28 +05:30
2024-07-16 17:10:28 +05:30
2024-07-12 07:27:18 +05:30
2024-07-16 17:10:28 +05:30
2024-07-12 07:27:18 +05:30
2024-07-12 07:27:18 +05:30
2024-07-12 07:27:18 +05:30
2024-07-12 07:27:18 +05:30
2024-07-16 17:14:11 +05:30
2024-07-16 17:10:28 +05:30

GPT-SoVITS CLI

This repository contains a command-line interface (CLI) script for the GPT-SoVITS project, which allows you to perform text-to-speech (TTS) synthesis using custom models.

Prerequisites

  • Docker

Setup

Build the Docker Image

To build the Docker image, run the following command:

docker build --no-cache -t gpt-sovits:latest .

Run the Docker Container

To run the Docker container, use the following command:

docker run -it --privileged --gpus all gpt-sovits:latest

Usage

To run the CLI script, use the following command:

python fakeyou_infer.py [OPTIONS]

Options

  • --use_pretrained_gpt: Use pretrained GPT model. If enabled, the script will use the default pretrained models for GPT and SoVITS and enable the ZeroShot capabilities.
  • --gpt_model: Path to GPT model checkpoint. Required if --use_pretrained_gpt is not enabled.
  • --sovits_model: Path to SoVITS model checkpoint. Required if --use_pretrained_gpt is not enabled.
  • --ref_audio: Path to reference wav file. Required unless --ref_free is enabled.
  • --ref_text: Path to reference text file. Required unless --ref_free is enabled.
  • --target_language: Language of the target text. Choices: chinese, english, japanese, chinese+english, japanese+english, automatic.
  • --ref_language: Language of the reference text. Choices: chinese, english, japanese, chinese+english, japanese+english, automatic. Required unless --ref_free is enabled.
  • --target_text: Path to the target text file. Required.
  • --how_to_cut: How to cut the text for synthesis. Default: No slice. Options: No slice, Slice once every 4 sentences, Cut per 50 characters, Slice by Chinese punct, Slice by English punct, Slice by every punct.
  • --top_k: Top K sampling. Default: 20.
  • --top_p: Top P sampling. Default: 0.6.
  • --temperature: Sampling temperature. Default: 0.6.
  • --ref_free: Perform reference-free TTS.
  • --output_path: Path to save the output wav file. Default: output.

Example Commands

Using Custom Models with Reference Audio

python fakeyou_infer.py --gpt_model GPT_weights/your_gpt_model.ckpt --sovits_model SoVITS_weights/your_sovits_model.pth --ref_audio data/voice/sponge.wav --ref_text data/voice/ref.txt --target_text data/voice/input.txt --target_language english --ref_language english --how_to_cut Slice once every 4 sentences --output_path output/

Using Custom Models Without Reference Audio

python fakeyou_infer.py --gpt_model GPT_weights/your_gpt_model.ckpt --sovits_model SoVITS_weights/your_sovits_model.pth --target_text data/voice/input.txt --target_language english --ref_free --how_to_cut "Slice once every 4 sentences" --output_path output/

Using Pretrained Models for using ZeroShot capabilities

python fakeyou_infer.py --use_pretrained_gpt --ref_audio data/voice/sponge.wav --ref_text data/voice/ref.txt --target_text data/voice/input.txt --target_language english --how_to_cut Slice once every 4 sentences --output_path output/