Skip to content

ouor/vits

 
 

Repository files navigation

How to use

(Suggestion) Python == 3.11

Clone this repository

git clone https://github.com/ouor/vits.git

Choose cleaners

  • Fill "text_cleaners" in config.json
  • Edit text/symbols.py
  • Text cleaner is korean by default
  • Remove unnecessary imports from text/cleaners.py

Install dependencies

python3.XX-dev is required for building monotonic alignment search. If you have multiple python versions, install the required version.

sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11-dev python3.11-venv

Create conda environment

conda create -n vits python=3.11
conda activate vits
conda install conda-forge::uv

Install requirements

uv pip install -r requirements.txt

Create datasets

Single speaker

"n_speakers" should be 0 in config.json

path/to/XXX.wav|transcript
  • Example
trains/korean/datasets/train/001.wav|안녕하세요.
...
trains/korean/datasets/val/001.wav|안녕하세요.

Mutiple speakers

Speaker id should start from 0

path/to/XXX.wav|speaker id|transcript
  • Example
trains/korean/datasets/train/001.wav|0|안녕하세요.
...
trains/korean/datasets/val/001.wav|0|안녕하세요.

Preprocess

If you have done this, set "cleaned_text" to true in config.json

# Single speaker
python preprocess.py --text_index 1 --filelists trains/sample/filelist_train.txt trains/sample/filelist_val.txt

# Mutiple speakers
python preprocess.py --text_index 2 --filelists trains/sample/filelist_train.txt trains/sample/filelist_val.txt

Build monotonic alignment search

cd monotonic_align
mkdir monotonic_align
python setup.py build_ext --inplace
cd ..

Train

# Single speaker
python train.py -c trains/sample/config.json -m trains/sample/models

# Mutiple speakers
python train_ms.py -c trains/sample/config.json -m trains/sample/models

Place pre-trained models in "trains/sample/models". Like "trains/sample/models/G_0.pth" and "trains/sample/models/D_0.pth"

Tensorboard

tensorboard --logdir=trains/sample/models

Inference

See inference.ipynb

Running in Docker

docker run -itd --gpus all --name "Container name" -e NVIDIA_DRIVER_CAPABILITIES=compute,utility -e NVIDIA_VISIBLE_DEVICES=all "Image name"

About

VITS implementation of Japanese, Chinese, Korean, Sanskrit and Thai

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 88.2%
  • Jupyter Notebook 8.2%
  • C++ 2.5%
  • Other 1.1%