Skip to content

StarxSky/tacotron2-JP

Repository files navigation

First of all, many thanks to the author: @CjangCjengh for the code and reference implementation! This repository is some corrections to the source project, to correct some errors, and will be improved and optimized from time to time.

How to use

  1. Put raw Japanese texts in ./filelists
  2. Put WAV files in ./wav
  3. (Optional) Download NVIDIA's pretrained model
  4. Open ./train.ipynb to install requirements and start training
  5. Download NVIDIA's WaveGlow model or WaveGlow model based on Ayachi Nene
  6. The pre-trained tacotron2 model is shown in this.
  7. Open ./inference.ipynb to generate voice(Please remember to modify the corresponding path where the model is stored!!)
  • Inference.ipynb
checkpoint_path = 'tacotron2_Model\\ayachi_nene_1'#"ayachi_nene_1"
model = load_model(hparams)

if torch.cuda.is_available() :
    model.load_state_dict(torch.load(checkpoint_path)['state_dict'])
    model.to(device).eval()
else :
    model.load_state_dict(torch.load(checkpoint_path, map_location='cpu')['state_dict'])
    model.to(device).eval()
  • Inference.ipynb
waveglow_path = 'W_Model\\model' #waveglow model
if hparams.cuda_enabled :
    waveglow = torch.load(waveglow_path)['model']
    waveglow.cuda().eval()#.half()
else :
    waveglow = torch.load(waveglow_path, map_location='cpu')['model']
    waveglow.to(device).eval()#.half()


for k in waveglow.convinv:
    k.float()
denoiser = Denoiser(waveglow)

Cleaners

File ./hparams.py line 30

1. 'japanese_cleaners'

Before

何かあったらいつでも話して下さい。学院のことじゃなく、私事に関することでも何でも

After

nanikaacltaraitsudemohanashItekudasai.gakuiNnokotojanaku,shijinikaNsurukotodemonanidemo.

2. 'japanese_tokenization_cleaners'

Before

何かあったらいつでも話して下さい。学院のことじゃなく、私事に関することでも何でも

After

nani ka acl tara itsu demo hanashi te kudasai. gakuiN no koto ja naku, shiji nikaNsuru koto de mo naNdemo.

3. 'japanese_accent_cleaners'

Before

何かあったらいつでも話して下さい。学院のことじゃなく、私事に関することでも何でも

After

:na)nika a)cltara i)tsudemo ha(na)shIte ku(dasa)i.:ga(kuiNno ko(to)janaku,:shi)jini ka(Nsu)ru ko(to)demo na)nidemo.

4. 'japanese_phrase_cleaners'

Before

何かあったらいつでも話して下さい。学院のことじゃなく、私事に関することでも何でも

After

nanika acltara itsudemo hanashIte kudasai. gakuiNno kotojanaku, shijini kaNsuru kotodemo nanidemo.

Models

Remember to change this line in ./inference.ipynb

sequence = np.array(text_to_sequence(text, ['japanese_cleaners']))[None, :]

Sanoba Witch

Ayachi Nene

Cleaners Classes Model
japanese_cleaners Model 1
japanese_tokenization_cleaners Model 2
japanese_accent_cleaners Model 3

Inaba Meguru

Cleaners Classes Model
japanese_tokenization_cleaners Model 1
japanese_tokenization_cleaners Model 2

Senren Banka

Tomotake Yoshino

Cleaners Classes Model
japanese_tokenization_cleaners Model 1
japanese_phrase_cleaners Model 2

Murasame

Cleaners Classes Model
japanese_accent_cleaners Model 1

RIDDLE JOKER

Arihara Nanami

Cleaners Classes Model
japanese_accent_cleaners Model 1