dathudeptrai commited on
Commit
d39eb11
1 Parent(s): fb4779d

Update french model

Browse files
Files changed (3) hide show
  1. README.md +81 -0
  2. config.yml +107 -0
  3. model.h5 +3 -0
README.md ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - tensorflowtts
4
+ - audio
5
+ - text-to-speech
6
+ - mel-to-wav
7
+ language: fr
8
+ license: apache-2.0
9
+ datasets:
10
+ - synpaflex
11
+ widget:
12
+ - text: "Oh, je voudrais tant que tu te souviennes Des jours heureux quand nous étions amis"
13
+ ---
14
+
15
+ # Multi-band MelGAN trained on Synpaflex (Fr)
16
+ This repository provides a pretrained [Multi-band MelGAN](https://arxiv.org/abs/2005.05106) trained on Synpaflex dataset (French)). For a detail of the model, we encourage you to read more about
17
+ [TensorFlowTTS](https://github.com/TensorSpeech/TensorFlowTTS).
18
+
19
+
20
+ ## Install TensorFlowTTS
21
+ First of all, please install TensorFlowTTS with the following command:
22
+ ```
23
+ pip install TensorFlowTTS
24
+ ```
25
+
26
+ ### Converting your Text to Wav
27
+ ```python
28
+ import soundfile as sf
29
+ import numpy as np
30
+
31
+ import tensorflow as tf
32
+
33
+ from tensorflow_tts.inference import AutoProcessor
34
+ from tensorflow_tts.inference import TFAutoModel
35
+
36
+ processor = AutoProcessor.from_pretrained("tensorspeech/tts-tacotron2-synpaflex-fr")
37
+ tacotron2 = TFAutoModel.from_pretrained("tensorspeech/tts-tacotron2-synpaflex-fr")
38
+ mb_melgan = TFAutoModel.from_pretrained("tensorspeech/tts-mb_melgan-synpaflex-fr")
39
+
40
+ text = "Oh, je voudrais tant que tu te souviennes Des jours heureux quand nous étions amis"
41
+
42
+ input_ids = processor.text_to_sequence(text)
43
+
44
+ # tacotron2 inference (text-to-mel)
45
+ decoder_output, mel_outputs, stop_token_prediction, alignment_history = tacotron2.inference(
46
+ input_ids=tf.expand_dims(tf.convert_to_tensor(input_ids, dtype=tf.int32), 0),
47
+ input_lengths=tf.convert_to_tensor([len(input_ids)], tf.int32),
48
+ speaker_ids=tf.convert_to_tensor([0], dtype=tf.int32),
49
+ )
50
+
51
+ # melgan inference (mel-to-wav)
52
+ audio = mb_melgan.inference(mel_outputs)[0, :, 0]
53
+
54
+ # save to file
55
+ sf.write('./audio.wav', audio, 22050, "PCM_16")
56
+ ```
57
+
58
+ #### Referencing Multi-band MelGAN
59
+ ```
60
+ @misc{yang2020multiband,
61
+ title={Multi-band MelGAN: Faster Waveform Generation for High-Quality Text-to-Speech},
62
+ author={Geng Yang and Shan Yang and Kai Liu and Peng Fang and Wei Chen and Lei Xie},
63
+ year={2020},
64
+ eprint={2005.05106},
65
+ archivePrefix={arXiv},
66
+ primaryClass={cs.SD}
67
+ }
68
+ ```
69
+
70
+ #### Referencing TensorFlowTTS
71
+ ```
72
+ @misc{TFTTS,
73
+ author = {Minh Nguyen, Alejandro Miguel Velasquez, Erogol, Kuan Chen, Dawid Kobus, Takuya Ebata,
74
+ Trinh Le and Yunchao He},
75
+ title = {TensorflowTTS},
76
+ year = {2020},
77
+ publisher = {GitHub},
78
+ journal = {GitHub repository},
79
+ howpublished = {\\url{https://github.com/TensorSpeech/TensorFlowTTS}},
80
+ }
81
+ ```
config.yml ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This is the hyperparameter configuration file for Multi-Band MelGAN.
2
+ # Please make sure this is adjusted for the Synpaflex dataset. If you want to
3
+ # apply to the other dataset, you might need to carefully change some parameters.
4
+ # This configuration performs 1000k iters.
5
+
6
+ ###########################################################
7
+ # FEATURE EXTRACTION SETTING #
8
+ ###########################################################
9
+ sampling_rate: 22050
10
+ hop_size: 256 # Hop size.
11
+ format: "npy"
12
+
13
+
14
+ ###########################################################
15
+ # GENERATOR NETWORK ARCHITECTURE SETTING #
16
+ ###########################################################
17
+ model_type: "multiband_melgan_generator"
18
+
19
+ multiband_melgan_generator_params:
20
+ out_channels: 4 # Number of output channels (number of subbands).
21
+ kernel_size: 7 # Kernel size of initial and final conv layers.
22
+ filters: 384 # Initial number of channels for conv layers.
23
+ upsample_scales: [8, 4, 2] # List of Upsampling scales.
24
+ stack_kernel_size: 3 # Kernel size of dilated conv layers in residual stack.
25
+ stacks: 4 # Number of stacks in a single residual stack module.
26
+ is_weight_norm: false # Use weight-norm or not.
27
+
28
+ ###########################################################
29
+ # DISCRIMINATOR NETWORK ARCHITECTURE SETTING #
30
+ ###########################################################
31
+ multiband_melgan_discriminator_params:
32
+ out_channels: 1 # Number of output channels.
33
+ scales: 3 # Number of multi-scales.
34
+ downsample_pooling: "AveragePooling1D" # Pooling type for the input downsampling.
35
+ downsample_pooling_params: # Parameters of the above pooling function.
36
+ pool_size: 4
37
+ strides: 2
38
+ kernel_sizes: [5, 3] # List of kernel size.
39
+ filters: 16 # Number of channels of the initial conv layer.
40
+ max_downsample_filters: 512 # Maximum number of channels of downsampling layers.
41
+ downsample_scales: [4, 4, 4] # List of downsampling scales.
42
+ nonlinear_activation: "LeakyReLU" # Nonlinear activation function.
43
+ nonlinear_activation_params: # Parameters of nonlinear activation function.
44
+ alpha: 0.2
45
+ is_weight_norm: false # Use weight-norm or not.
46
+
47
+ ###########################################################
48
+ # STFT LOSS SETTING #
49
+ ###########################################################
50
+ stft_loss_params:
51
+ fft_lengths: [1024, 2048, 512] # List of FFT size for STFT-based loss.
52
+ frame_steps: [120, 240, 50] # List of hop size for STFT-based loss
53
+ frame_lengths: [600, 1200, 240] # List of window length for STFT-based loss.
54
+
55
+ subband_stft_loss_params:
56
+ fft_lengths: [384, 683, 171] # List of FFT size for STFT-based loss.
57
+ frame_steps: [30, 60, 10] # List of hop size for STFT-based loss
58
+ frame_lengths: [150, 300, 60] # List of window length for STFT-based loss.
59
+
60
+ ###########################################################
61
+ # ADVERSARIAL LOSS SETTING #
62
+ ###########################################################
63
+ lambda_feat_match: 10.0 # Loss balancing coefficient for feature matching loss
64
+ lambda_adv: 2.5 # Loss balancing coefficient for adversarial loss.
65
+
66
+ ###########################################################
67
+ # DATA LOADER SETTING #
68
+ ###########################################################
69
+ batch_size: 64 # Batch size for each GPU with assuming that gradient_accumulation_steps == 1.
70
+ batch_max_steps: 8192 # Length of each audio in batch for training. Make sure dividable by hop_size.
71
+ batch_max_steps_valid: 8192 # Length of each audio for validation. Make sure dividable by hope_size.
72
+ remove_short_samples: true # Whether to remove samples the length of which are less than batch_max_steps.
73
+ allow_cache: true # Whether to allow cache in dataset. If true, it requires cpu memory.
74
+ is_shuffle: true # shuffle dataset after each epoch.
75
+
76
+ ###########################################################
77
+ # OPTIMIZER & SCHEDULER SETTING #
78
+ ###########################################################
79
+ generator_optimizer_params:
80
+ lr_fn: "PiecewiseConstantDecay"
81
+ lr_params:
82
+ boundaries: [100000, 200000, 300000, 400000, 500000, 600000, 700000]
83
+ values: [0.0005, 0.0005, 0.00025, 0.000125, 0.0000625, 0.00003125, 0.000015625, 0.000001]
84
+ amsgrad: false
85
+
86
+ discriminator_optimizer_params:
87
+ lr_fn: "PiecewiseConstantDecay"
88
+ lr_params:
89
+ boundaries: [100000, 200000, 300000, 400000, 500000]
90
+ values: [0.00025, 0.000125, 0.0000625, 0.00003125, 0.000015625, 0.000001]
91
+
92
+ amsgrad: false
93
+
94
+ gradient_accumulation_steps: 1
95
+ ###########################################################
96
+ # INTERVAL SETTING #
97
+ ###########################################################
98
+ discriminator_train_start_steps: 200000 # steps begin training discriminator
99
+ train_max_steps: 4000000 # Number of training steps.
100
+ save_interval_steps: 20000 # Interval steps to save checkpoint.
101
+ eval_interval_steps: 5000 # Interval steps to evaluate the network.
102
+ log_interval_steps: 200 # Interval steps to record the training log.
103
+
104
+ ###########################################################
105
+ # OTHER SETTING #
106
+ ###########################################################
107
+ num_save_intermediate_results: 1 # Number of batch to be saved as intermediate results.
model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9539a243656b2615d7c48997ea5bce8011684f86c14a30a6af19b9c149bf4de
3
+ size 10232552